Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help with select query

Author  Topic 

dineshreddy
Starting Member

7 Posts

Posted - 2011-03-18 : 14:02:12
Need to get a result set from three tables as shown below

Table1
UserID RoleID
A0 1
A0 2
A1 3
A1 1
A2 1

Table2
UserID UserNM
A0 bill
A1 tim
A2 john

Table3
RoleID RoleNM
1 admin
2 sysadmin
3 user
4 general

Result of the select Query should be this:

UserNM admin sysadmin user general
bill 1 1 0 0
tim 1 0 1 0
john 1 0 0 0


Thanks in Advance

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-03-18 : 14:20:41
Please do not double post, continue with the original thread:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=158377
Go to Top of Page
   

- Advertisement -