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 |
|
tandel
Starting Member
2 Posts |
Posted - 2011-07-06 : 08:14:57
|
hello,I want to combine resulted 3 column into 1 comlumn, please help me.SELECT DAS_Card_Archive.Das_Card_ID as [Das Card ID], DAS_Card_Line.Das_Card_ID as [Das Card ID], DAS_Card_Session.Das_Card_ID as [Das Card ID]FROM DAS_Card_Archive FULL OUTER JOIN DAS_Card_Line ON DAS_Card_Archive.Das_Card_ID = DAS_Card_Line.Das_Card_ID FULL OUTER JOIN DAS_Card_Session ON DAS_Card_Line.Das_Card_ID = DAS_Card_Session.Das_Card_IDResultDas Card ID Das Card ID Das Card ID----------- ----------- -----------5 NULL NULL6 NULL NULLNULL 1 NULLNULL 2 NULLNULL 4 NULLNULL NULL 7NULL NULL 8NULL NULL 9i want resultDas Card ID ----------- 5 6 124789please help me..thanks in advance..  |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-07-06 : 08:21:42
|
| SELECT Das_Card_ID = coalesce(DAS_Card_Archive.Das_Card_ID, DAS_Card_Line.Das_Card_ID, DAS_Card_Session.Das_Card_ID)FROM DAS_Card_ArchiveFULL OUTER JOIN DAS_Card_LineON DAS_Card_Archive.Das_Card_ID = DAS_Card_Line.Das_Card_ID FULL OUTER JOIN DAS_Card_SessionON DAS_Card_Line.Das_Card_ID = DAS_Card_Session.Das_Card_ID==========================================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. |
 |
|
|
tandel
Starting Member
2 Posts |
Posted - 2011-07-06 : 08:30:43
|
| thanks you nigelrivett........ cheers |
 |
|
|
|
|
|