hope someone can help. I have two tables:
Users
-UserID
-UserName
UsersType
-UserTypeID
-UserID
Possible values for UsersTypeID is 1 to 6. In that scenario Users may have multiple types and I need to retrieve a distinct row for each user with the columns described below.
UserName - Type1 - Type2 - Type3 - Type4
Joe 0 1 1 0
In this scenario, Joe has two different User type (2,3)
This might be easy as pie but I have been working around this for so long that I am clueless. Can some one help please.
This is a standard crosstab output which you should be able to google. Although not recommended in SQL you can do something like:
(Updated to Max instead of Min)