I have a table as below
Name Priority Date
-------------------------
A 2 d1
B 3 d2
How to write a query to achieve the below output
ColumnNames d1 d2
--------------------------
Name A B
Priority 2 3
Thanks
Here is the solution I promised:
EDIT: I modified my answer to answer additional questions by the OP.
A few things to note:
Read this page for more information on converting dates to strings.
With that said, here is the code:
Lets run through this a little
Once I do this, the data will look something like this:
Then we can use PIVOT like this to get all the columns we need: