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
 Transact-SQL (2000)
 Converting rows into one column

Author  Topic 

aww77
Starting Member

1 Post

Posted - 2007-10-15 : 12:54:20
Hi,

I have the result set where for each Pat_id I need all Text in one row

PAT_ID ID Text
5 215 Subarachnoid haemorrhage
6 218 Cardiac arrhythmiac
5 215 Aortic dissection
5 215 Heart failure

e.g.

PAT_ID ID Text
5 215 Subarachnoid haemorrhage; Aortic dissection; Heart failure
6 218 Cardiac arrhythmiac


I can get it so all the Text appears on one line but not the grouping so that it still splits by pat_id.
Your help would be appreciated.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-15 : 13:04:35
see http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2007-10-18 : 04:56:57
you may used Rob Volk worlds famous crosstab :-)

http://www.sqlteam.com/article/dynamic-cross-tabs-pivot-tables




Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page
   

- Advertisement -