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
 left join

Author  Topic 

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2014-02-18 : 21:51:12
tableA has ID 12345 and 54321, houseID 88888 and 99999
tableB has ID 12345 and 54321, houseIS 88888

how can i select * from tableA

i tried this but it only appear those which match

select * from tableA left join tableB where tableA.ID=tableB.ID and tableA.houseID=tableB.houseID

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-02-19 : 00:23:02
Your query is correct. If you aren't getting the correct results, please post better sample data.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -