Pivoting data using SQL 2008

I'm having some trouble with the syntax on this.

SELECT a.[Id]
  ,a.[Ext]
  ,a.[Title]
  ,b.Text
  FROM [Sliders] a
  LEFT OUTER JOIN SliderItems b on b.SliderId = a.Id

That returns a dataset like this:

Id                                    Ext   Title       Text
1140E5F9-7ABB-42D6-B054-9D30461FC4A9 .jpg Test me big asdftyrthg
1140E5F9-7ABB-42D6-B054-9D30461FC4A9 .jpg Test me big asdfd22sdf
1140E5F9-7ABB-42D6-B054-9D30461FC4A9 .jpg Test me big asdf342324543
1140E5F9-7ABB-42D6-B054-9D30461FC4A9 .jpg Test me big asdf;l;po09

What I really need to do is pivot the data out so that the different text items are each in their own column.

Thanks.

Edit: I think this is closer, but it is telling me the column ID is specified multiple times, can't get rid of that one.

SELECT *
FROM
(SELECT Id, Title FROM Sliders)AS a
LEFT JOIN SliderItems s on (s.SliderId = a.Id)
PIVOT
(
  MAX(s.Text)
FOR s.Text IN ([One],[Two],[Three],[Four])
) AS p

Answers


SELECT *
FROM
(
  SELECT a.Id, a.Title, b.Text
  FROM dbo.Sliders AS a
  LEFT JOIN dbo.SliderItems b on b.SliderId = a.Id
) AS s
PIVOT
(
  MAX(s.Text)
  FOR s.Text IN ([One],[Two],[Three],[Four])
) AS p

Need Your Help

Rotating a picture using mouse position in C#

c# rotation image image-rotation mouse-coordinates

Basically what I'm trying to do is have a picture rotate using mouse events. For example, while you hold down the left mouse button, the picture rotates when you move the mouse up and down. I found

android speech to text (speech recognition ,voice)

android speech-recognition speech-to-text

I want to ask how I can use speech to text code on my emulator. My codes work on real device but not work on emulator. The error said :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.