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 |
aitaiaitai
Starting Member
3 Posts |
Posted - 2012-05-27 : 21:06:56
|
In MS SQL (2008), is it possible to return multiple values from a single column in a single row with the following subquery?-----select dic_kanji_primary,dic_previous_jis,dic_etymology_1, ( select dio_reading from tbl_dictionary_on where dic_id_pk = dio_id_fpk ) as dio_readingfrom tbl_dictionary_kanjiwhere 1=1and dic_ecu_indicator='1'-----The "dio_reading" column in the subquery should return multiple values.Any help will would be greatly appreciated - Thanks in advance! |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
aitaiaitai
Starting Member
3 Posts |
Posted - 2012-05-27 : 21:23:13
|
Thanks for response, khtan. Not sure what I should be looking at though... |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-27 : 21:27:04
|
[code]select dic_kanji_primary,dic_previous_jis,dic_etymology_1, stuff( ( select ',' + dio_reading from tbl_dictionary_on where dic_id_pk = dio_id_fpk for xml path('') ), 1, 1, '') as dio_readingfrom tbl_dictionary_kanjiwhere 1=1and dic_ecu_indicator='1'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
aitaiaitai
Starting Member
3 Posts |
Posted - 2012-05-27 : 21:35:25
|
That did the trick - Much appreciated, khtan! |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-27 : 21:45:27
|
welcome KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|