SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 left join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

420 Posts

Posted - 02/18/2014 :  21:51:12  Show Profile  Reply with Quote
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

Almighty SQL Goddess

38119 Posts

Posted - 02/19/2014 :  00:23:02  Show Profile  Visit tkizer's Homepage  Reply with Quote
Your query is correct. If you aren't getting the correct results, please post better sample data.

Tara Kizer
SQL Server MVP since 2007
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000