HoustonGuy
Programmer
I have a table that spills out this way:
I would like the results this way:
Currently I create a temp table and update Columns 2 thru 5 based on Column1 to flatten it out.
Question:
1) How can I flatten this table without using a mathematical function? Most Pivot/Crosstab tables I see created must use the SUM, MAX function etc.
2) Do I pivot this on MAX(Column1)?
3) Is using a temp table to flatten data acceptable?
Thank you!
SQL:
Column1 Column2 column3 Column4 Column5 etc...
John Attended
John Attended
John Attended
Tom Attended
Tom Attended
Jill Attended
Jill Attended
I would like the results this way:
SQL:
Column1 Column2 column3 Column4 Column5 etc...
John Attended Attended Attended
Tom Attended Attended
Jill Attended Attended
Currently I create a temp table and update Columns 2 thru 5 based on Column1 to flatten it out.
Question:
1) How can I flatten this table without using a mathematical function? Most Pivot/Crosstab tables I see created must use the SUM, MAX function etc.
2) Do I pivot this on MAX(Column1)?
3) Is using a temp table to flatten data acceptable?
Thank you!