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 |
|
Apples
Posting Yak Master
146 Posts |
Posted - 2008-10-07 : 10:32:26
|
| Here's my schema:--------------------------------------------------------tblOrders--------------------------------------------------------OrderID | ConfirmationNumber----------------------------------------------------------------------------------------------------------------tblTransactions--------------------------------------------------------TransactionID | ConfirmationNumber--------------------------------------------------------I want to select all the records from tblOrders that don't have a confirmation number in tblTransactions. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-07 : 10:40:20
|
| select * from tblOrders as orderswhere not exists(select * from tblTransactions where ConfirmationNumber=orders.ConfirmationNumber)MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-07 : 11:59:21
|
| or use left join select o.* from tblOrders as orders oleft join tblTransactions ton t.ConfirmationNumber=o.ConfirmationNumberwhere t.ConfirmationNumber is null |
 |
|
|
|
|
|