rgn2121
asked on
Sql Server 2005, Convert column to rows
I have a query that returns me data like what I have below...
Temp1_TS Temp2_TS
NULL 2011-11-01 18:08:59.883
2011-11-02 03:01:45.843 NULL
I would really like to have:
Temp1_TS Temp2_TS
2011-11-02 03:01:45.843 2011-11-01 18:08:59.883
I tried using Coalesce(Temp1_TS, Temp2_TS), but that gives me a single column with 2 rows. I need a single row, with 2 correctly named columns.
thanks,
rgn
Temp1_TS Temp2_TS
NULL 2011-11-01 18:08:59.883
2011-11-02 03:01:45.843 NULL
I would really like to have:
Temp1_TS Temp2_TS
2011-11-02 03:01:45.843 2011-11-01 18:08:59.883
I tried using Coalesce(Temp1_TS, Temp2_TS), but that gives me a single column with 2 rows. I need a single row, with 2 correctly named columns.
thanks,
rgn
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks! I will always only have 2 columns, not possible about rows. I will have to look into that...
ASKER
Sorry, I meant, "Not sure about rows.."
ASKER