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 |
|
satheesh
Posting Yak Master
152 Posts |
Posted - 2011-04-20 : 09:51:35
|
| Dear All,I need to retrive all data from cst table where cst.transid not in filter.cstid or filter.quoteidie.this 'transid' field contain both cstid and quoteid(mixed).So i need to find the unique data from cst table by eliminating existing cstid and quoteid using filter tablethere is no other common field to make join.How to filter this.Any help would be highly appreciated.Regards,SG |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-04-20 : 09:56:13
|
| SELECT * FROM cst cWHERE NOT EXISTS(SELECT * FROM filter WHERE cstid=c.transID OR quoteid=c.transid) |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-20 : 09:57:14
|
| select *from cstwhere transid not in (select cstid from filter)and transid not in (select quoteid from filter)==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|