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 |
sql2020
Yak Posting Veteran
54 Posts |
Posted - 2010-11-23 : 06:19:43
|
I have Table A and B. Table A under sample database, B table under sample2 databaseif USE sampleSelect * from A Results is 1000 rowsifUse sample2Select * from B Results is 1100 rowsi want query for that extra 100 rows only. help on thissql2020 |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-11-23 : 06:23:54
|
You need a unique column in bot tables to join on.select b.*from bleft join aon a.col = b.colwhere a.col is nullor maybeselect * from bexceptselect * from a(it's v2000 so this might not work - don't think it was available in that release)==========================================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. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-23 : 07:32:03
|
quote: Originally posted by nigelrivett You need a unique column in bot tables to join on.select b.*from sample2..b as bleft join sample..a as aon a.col = b.colwhere a.col is nullor maybeselect * from bexceptselect * from a(it's v2000 so this might not work - don't think it was available in that release)==========================================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.
No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
|
|
|