December 5, 2014 at 10:36 am
How to make it crosstab query?
From
ID--Red--Yellow--Green
AA--X
AA----------X
BB------------------X
BB--X
BB----------X
To
ID--Red--Yellow--Green
AA--X-------X
BB--X-------X-------X
December 5, 2014 at 10:40 am
Why cross tab if a simple aggregate works?
SELECT ID,
MAX(Red) AS Red,
MAX(Yellow) AS Yellow,
MAX(Green) AS Green
FROM Sometable
GROUP BY ID
December 5, 2014 at 12:06 pm
It works.
Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply