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
 General SQL Server Forums
 New to SQL Server Programming
 Required out put format-tricky

Author  Topic 

kvishnuprasad
Starting Member

13 Posts

Posted - 2008-07-16 : 17:30:58
Hi
I have table like this
Table name Student

Name subject marks
x cc 22
x rr 18
x uu 51
y cc 11
y rr 12
y uu 14
z kk 12
z ll 14

I want to write a query to see the results in this way
x ;22;18;51;
y ;11;12;14;
z :12;14;

help me in getting this!!!!!

I want to do this because i want to move the complete data of
X ie (;22;18;51;) different table.

Is this possible if yes let me know , that would be a great help

Regards,
Vishnu


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-16 : 17:40:44
Use Cross Apply if you are on SQL Server 2005 or any other concatenating function available here at SQLTeam.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

kvishnuprasad
Starting Member

13 Posts

Posted - 2008-07-16 : 18:08:38
i dint get u
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-17 : 05:04:49
quote:
Originally posted by kvishnuprasad

i dint get u


http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-17 : 05:12:29
http://www.projectdmx.com/tsql/rowconcatenate.aspx
Go to Top of Page
   

- Advertisement -