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.
| Author |
Topic |
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2009-03-31 : 00:54:24
|
Here is my query problemCustomer:CustId CompanyName------ ----------- 10000 VSN labs20000 cez labs 30000 win labs Customer detail:CustId Pincode ------- 10000 600 00120000 500 001I need to dispaly the value of customer who is having 600 001 and who doesn't have the customer details record.Result should be like thiscustomer companyname-------- -----------10000 VSN labs30000 win labscould you help me out to get the records in single query..Thanks in advance.Thiya Thiyahttp://knowmoreax.blogspot.com/ |
|
|
abcd
Yak Posting Veteran
92 Posts |
Posted - 2009-03-31 : 01:09:08
|
| but why this record u want to have in ur output???customer companyname-------- -----------10000 VSN labs |
 |
|
|
matty
Posting Yak Master
161 Posts |
Posted - 2009-03-31 : 01:37:28
|
| SELECT C.CustId,CompanyNameFROM Customer c LEFT JOIN CustomerDetail cd ON c.CustId = cd.CustId WHERE cd.CustId IS NULL OR cd.PinCode = '600 001' |
 |
|
|
|
|
|