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 |
svibuk
Yak Posting Veteran
62 Posts |
Posted - 2013-02-02 : 07:38:49
|
[code]select lang +',' from M_LANG l inner join sel_lang s on l.LID=s.lcode where mcode in('000001') for xml path('')[/code]the output i get is XML_F52E2B61-18A1-11d1-B105-00805F49916BEnglish,French,but i need the output as LAnguageEnglish,French, |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-02 : 07:59:42
|
Wrap it in another select and give it an aliasSELECT ( select lang +',' from M_LANG l inner join sel_lang s on l.LID=s.lcode where mcode in('000001') for xml path('') ) as Language |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-02 : 08:01:54
|
[code]SELECT Language FROM(SELECT STUFF((select lang +',' from M_LANG l inner join sel_lang s on l.LID=s.lcode where mcode in('000001') for xml path('')),1,1,'') AS Language)t[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-02 : 08:05:00
|
quote: Originally posted by visakh16
SELECT Language FROM(SELECT STUFF((select ','+lang from M_LANG l inner join sel_lang s on l.LID=s.lcode where mcode in('000001') for xml path('')),1,1,'') AS Language)t ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
A little fixing up |
|
|
svibuk
Yak Posting Veteran
62 Posts |
Posted - 2013-02-03 : 00:58:29
|
THANKSquote: Originally posted by James K
quote: Originally posted by visakh16
SELECT Language FROM(SELECT STUFF((select ','+lang from M_LANG l inner join sel_lang s on l.LID=s.lcode where mcode in('000001') for xml path('')),1,1,'') AS Language)t ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
A little fixing up
|
|
|
|
|
|
|
|