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 |
|
Access
Starting Member
44 Posts |
Posted - 2007-11-03 : 17:06:26
|
| I have two temp tables that I'm creating on the fly.It is basically the words and their synonyms.1.ID NAME1 FAST2 WHILD1 QUICK3 SUNNY4 PERFECT3 BRIGHT2.ID32I need to have a query which will return everything from first (1) table with identified rows that are in the second (2) table. The identifier can be anything, lets put word "-selected" next to matched name for now.In this case it will be next output:FASTWHILD - selectedQUICKSUNNY - selectedPERFECTBRIGHT - selectedThank you |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-11-03 : 18:02:01
|
| select t1.name, case when t2.ID is null then '' else 'selected' endfrom #t1 t1left join #t2 t2on t1.ID = t2.ID==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Access
Starting Member
44 Posts |
Posted - 2007-11-04 : 00:59:08
|
quote: Originally posted by nr select t1.name, case when t2.ID is null then '' else 'selected' endfrom #t1 t1left join #t2 t2on t1.ID = t2.ID==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.
M-V-P....M-V-PThanks it works. |
 |
|
|
|
|
|