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 2005 Forums
 Transact-SQL (2005)
 Query needed for the below mentioned layout

Author  Topic 

kumarvashanth
Starting Member

4 Posts

Posted - 2009-04-29 : 10:51:58
In my table i am having three columns named
this is my current table structure

PID VID COM
1 1 neckpain
1 1 backpain
1 1 headache
2 2 throatpain
3 3 neckpain


My ouput should like this
PID VID COM
1 1 neckpain,backpain,headache
2 2 throatpain
3 3 neckpain



I required a query for this table layout

If PID & VID are same for two records then COM value
should be in single row separated bby Comma


I am using SSRS to execute this table and i am new to SSRS, so stright away in am passing table to SSRS

If anyone knows this kindly help me in this, its an urgent requirement
millions of thanks in advance

thanks
vashanth


Qualis
Posting Yak Master

145 Posts

Posted - 2009-04-29 : 11:20:12
Look up pivoting with SQL Server 2005
Go to Top of Page

kumarvashanth
Starting Member

4 Posts

Posted - 2009-05-04 : 01:18:55
quote:
Originally posted by Qualis

Look up pivoting with SQL Server 2005




thanks for reply

i am not sure on pivoting concept

i have to connect this above required layout
with another view by using VID field

will you able to give the query for this

thanks



Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-04 : 02:54:36
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Madhivanan

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

- Advertisement -