siva nathan

siva nathan

  • 876
  • 819
  • 216.7k

how convert row as column using pivot in sql

Apr 10 2017 7:38 AM
 i have a table  record ike this i want to convert rows as columns using pivot
 attdate present
  04-01-17 x
  04-02-17 /
  04-03-17 L
  04-04-17 AB
i want to convert attdate as column and data is present
like this
here 1,2,3 as attdate ==>day 
 1 2 3 4 5
 x / L AB 
how to write a query for this 

Answers (12)