I have a table like this:
id | Date 1 | Date 2 | Date 3 1 | 2014-08-01 | 2014-08-02 | 2014-08-03
And I have to output it like this:
id | Date Field Name | Date value 1 Date 1 | 2014-08-01 1 | Date 2 | 2014-08-02 1 | Date 3 | 2014-08-03
Attempted dynamic unemployment with the unions but it seems there is a mess. Is this the best way to do this?
I think UNPIVOT
is the best practice here to make me feel so messy Not as much as it is confusing, probably because I do not reach this often, it will give results that you find:
My Date (Date Name), [Date Field] From [Date Field] [Date Field Name] IN ([Date1], [Date2], [Date3]) X
Comments
Post a Comment