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
 Make Rows As Columns

Author  Topic 

moayad
Starting Member

2 Posts

Posted - 2012-02-20 : 03:52:54
Dears ,

I have very hard View , that making the Rows to Column , but i couldn't Find the Solution for that

i have below view which is Steps done from the Users, and this view sorted by EventTime



so i want to Change the View to retrieve Data as New View below

in the new view i just make it manual in table to show how it should be



Regards,

Moayad Al-Saleh


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-02-20 : 06:53:43
[code]
SELECT ProductID,
StartTime = min(EventTime),
EndTie = max(EventTime),
RoleID, RoleName
FROM YourTable
GROUP BY ProductID, RoleID, RoleName
[/code]


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

Go to Top of Page
   

- Advertisement -