I am not sure if this would be called pivoting.
Data in my SQL 2005 table [CustromerRoles] is as such:
CustId RoleId
2 4
2 3
3 4
4 1
4 2
[Roles] table:
RoleId Role
1 Admin
2 Manager
3 Support
4 Assistant
I want to create a view such that:
SELECT * FROM [MYVIEW] will give me the data below:
The 1 & 0's will be bits so that I can display a grid with checkboxes on my UI display.
CustId Admin Manager Support Assistant
2 0 0 1 1
3 0 0 0 1
4 1 1 0 0
So far I have no idea how to go about doing this.