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 |
|
ann
Posting Yak Master
220 Posts |
Posted - 2009-09-30 : 18:25:20
|
| I need to know if a certain id exists in either of 2 different tables:TableA:ID = 2ID = 6ID = 4TableB:ID = 4ID = 19Results expected if parameter 2 is used: trueResults expected if parameter 4 is used: trueResults expected if parameter 19 is used: trueResults expected if parameter 33 is used: falseI tried doing an inner join but get no results:select TableA.ID, TableB.ID from TableAInner Join TableB on TableA.ID = TableB.ID |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-10-01 : 02:12:13
|
| or apply to each table and union themSELECT ID FROM TableA WHERE ID = @nUNION ALL SELECT ID FROM TableBWHERE ID = @nMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|