Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql statemt to return all records even if 1 table blank

Status
Not open for further replies.

gypsylady

Technical User
Jul 11, 2001
11
US
Trying to write a sql statement to return all records from 3 tables, but it is eliminating the records if data is missing from a related table.

My statement select * from table 1 table 2 table 3
where table1.idnum=table2.idnum and table2.idnum=table3.idnum.

How can I get the data to report for tables 1 and 2 if there is no related data in table3?
 
try using a right outer join on table 3 this should bring out ALL the records fron table 3 where id'S MATCH ON TABLE 1,2,3 AND EVEN THE RECORDS THAT DONT MATCH ON TABLE THREE

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top