SQL how to do a pivot of one column regardless of the data -


I basically need to change more than one line in a line

So the basic form Follow me with the result myId apple beer tiger

and I want to convert it to apple Bear | Tiger but how can I do this with a pivot, to find out what the outcome of the data is going to be? I tried

SELECT * (myTable from SELECT TOP (3) myTable) src PIVOT (myId) myId IN ([1], [2], [3]) PIIT ;

but the data is not [1], [2], [3]

You can use ROW_NUMBER () for the number of rows, and they can be used to manually convert the fields into fields;

  with cte as (SELECT myId, ROW_NUMBER) ORDER BY MYId) from RAM mytable) Select MAX (case when RN = 1 then my IDEnd) field 1, max (case when RN = 2 Then my IDEnd) field 2, max (in case RN = 3 then mineind) field 3 whistle;   

.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -