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 |
|
Starlet_GT
Yak Posting Veteran
81 Posts |
Posted - 2009-08-19 : 01:33:10
|
| Guys, I need to check two conditions while running a query.Suppose I have two tablesTable A--------------Table BCol1---Col2----------Col1---Col2 A-------1--------------A-----2B-------5--------------B-----5C-------7--------------C-----7D-------1--------------E-----3F-------8G-------1I want to select all data from Table A where two colums are different and all values of Table A which did not exists in Table BResults should be like this:Col1---Col2A-------1D-------1F-------8G-------1how to do it ... Thanks in advance Best regards,MIZ |
|
|
Mangal Pardeshi
Posting Yak Master
110 Posts |
Posted - 2009-08-19 : 01:35:24
|
| [code]SELECT col1, col2FROM TableAEXCEPTSELECT col1, col2FROM TableB[/code]Mangal Pardeshihttp://mangalpardeshi.blogspot.com |
 |
|
|
Starlet_GT
Yak Posting Veteran
81 Posts |
Posted - 2009-08-19 : 01:44:09
|
| Thank you ... it's work :) |
 |
|
|
|
|
|