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 to return 2 rows result in single row

Author  Topic 

ryanlcs
Yak Posting Veteran

62 Posts

Posted - 2010-06-23 : 22:53:42
I got a simple query that return result of this, 2 columns (Param_Value and Rec_Id), and 2 rows of result.

Param_Value | Rec_Id
2010-06-11 :22:22:22 | 1
Process1 | 1

Is there a single query that can retrieve the result to be like this?
Only 1 single rows of result with the param_value combine.

Param_Value | Rec_Id
Process 1 2010-06-11 :22:22:22 | 1

Pls advice.


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-06-23 : 22:56:02
you can use PIVOT operator for that


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

Go to Top of Page
   

- Advertisement -