Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
I have 2 tables in SQL Sever 2000.
Tables contains data as follows
Table1 (User Id & their role)
User_Id Role
1 a
1 b
1 c
2 a
2 b
2 d
2 f
3 c
3 d
3 e
and so on.
Table2(Role List)
Role
a
b
c
d
e
f
g
h
I need a create a query that will give me output like this:
User_Id Role
1 a,b,c
2 a,b,d,f
3 c,d,e
with 1 condition
Where Table1.Role = Table2.Role
Thanks & Regards
Suveen Mohan
Posted
Updated 19-Oct-10 4:26am
v2
Comments
Abhinav S 19-Oct-10 10:28am    
Looks like you will have to redesign the way the grid is populated.
Sandeep Mewara 19-Oct-10 11:02am    
Not clear.

1 solution

You need to a function to get the roles in comma separated value and use it along with a SELECT statement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900