Link to home
Create AccountLog in
Avatar of rgn2121
rgn2121Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of rgn2121

ASKER

this is before the coalesce correct?
Avatar of rgn2121

ASKER

Thanks!  I will always only have 2 columns, not possible about rows.  I will have to look into that...
Avatar of rgn2121

ASKER

Sorry, I meant, "Not sure about rows.."