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 |
|
walank
Starting Member
12 Posts |
Posted - 2010-03-10 : 23:01:21
|
| I have 2 tables: table1, table2table1 has 1 column: my_key (integer, primary key)table2 has 2 columns: my_key (integer, foreign key), city char(50)Lets say I have 1 record in table1:1000and 3 records in table2:1000, Chicago1000, San Diego1000, PhoenixI want a query which will return this:"1000" "Chicago, San Diego, Phoenix"something like:SELECT table1.my_key, (SELECT magic_function_here(table2.city) WHERE table2.my_key=table1.my_key) as my_text FROM table1Any sugesstion how to accomplish this in bare SQL (no stored proc,etc) ? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|