This isn't the first time I've been faced with this type of problem and I've still yet to figure it out.
I'm trying to pull the records of an employee and find which races they are. The way the data is returned currently is as:
Emp # | Race
-------------
1111 | White
1111 | Asian
I would like it to look like this in the end:
Emp # | White | Black | Hispanic | Asian | Indian | Other
---------------------------------------------------------
1111 | Y | N | N | Y | N | N
I've attempted this through CTE's and the PIVOT function, but I may have just not had a great understanding of how the use PIVOT.