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 |
|
colski
Starting Member
4 Posts |
Posted - 2003-02-09 : 10:59:43
|
| I want to be able to have one of the columns of my query returning a list of ID's associated with each row. I have seen several snippets of SQL that show how to return a list but as far as I can see they would not work as a sub query. Please tell me how I can get around this. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-02-09 : 11:56:00
|
| Can you provide some more background on why you need it as a subquery? I can see why you want it as EITHER a list or a subquery, but not both (to me it defeats the purpose) If you have any SQL statements you're using now and the structure of the tables you're using it would be immensely helpful if you could post them. |
 |
|
|
colski
Starting Member
4 Posts |
Posted - 2003-02-10 : 04:59:34
|
| I have two tables:Tasks:-task_id-task_summaryDependencies:-parent_task_id-child_task_idWhat I want to achieve is to pull out all the tasks with the ID's of each tasks children as a list.Something like:task_id | task_summary | children--------------------------------------------- 1 Go to work 2,3,4 2 Turn on computer 3 Ask SQL question 4 Get my problems solved 5 5 Go home happy |
 |
|
|
colski
Starting Member
4 Posts |
Posted - 2003-02-10 : 05:03:25
|
quote: I have two tables:Tasks:-task_id-task_summaryDependencies:-parent_task_id-child_task_idWhat I want to achieve is to pull out all the tasks with the ID's of each tasks children as a list.Something like:task_id | task_summary | children---------------------------------------------- 1 | Go to work | 2,3,4 2 | Turn on computer | 3 | Ask SQL question | 4 | Get my problems solved | 5 5 | Go home happy |
My ultimate reason for wanting the results like this is to display a matrix of task dependencies using a HTML table. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|
|
|