Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Retrieve Data from two tables

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-01-25 : 15:05:30
I need to retrieve data from 2 tables (I have a sp that populates each table) regardless if they have a match or not.

First table:
#JobListTable
job_date datetime,
job_number char(15),
job_phase char(15),
qty_delivered decimal(8,2)

Second table:
#EquentialJobListTable
job_date datetime,
job_number char(15),
job_phase char(15),
qty_received decimal(8,2)

There could be a match between the two tables, or a record could exist in one and not in the other. Result will be loaded into a DataSet and dataGrig

Can I use a join?

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2008-01-25 : 15:07:39
If they did "match", what column(s) would the "match" on?

Once you decide on the answer to the above, you are going to need a full outer join.

Jay
to here knows when
Go to Top of Page

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-01-25 : 15:13:51
Match are the first 3 columns from each of the two tables.
Go to Top of Page
   

- Advertisement -