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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 advanced select returning rows , comma delimited

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-31 : 09:01:49
amit writes "hi, how can i achieve this :
i have a say subcategory table that has two columns
1. category_id
2. subcategory_id

i want a recordset such that for each category_id give me the comma(or any other delimiter) separated list of subcategory ids.

i.e the resultset should contain category_id only once along with the other column containing the subcategory id's

i would prefer a non stored-procedure and pure sql method"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-31 : 09:07:44
quote:
i would prefer a non stored-procedure and pure sql method"


<screaming, foaming rant>What's wrong with using stored procedures????</screaming, foaming rant>

This should work:

http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=9978

Edited by - robvolk on 01/31/2002 09:08:46
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-01-31 : 09:39:56
quote:

<screaming, foaming rant>[...]</screaming, foaming rant>


I do wish people would post syntactically valid XML


Go to Top of Page

lfmn
Posting Yak Master

141 Posts

Posted - 2002-01-31 : 13:18:27
since when is a stored proc not pure SQL?

Maybe you could try a cursor

cursors are like hammers - sometimes you have to use them, but watch your thumb!
Go to Top of Page
   

- Advertisement -