|
divyaram
Posting Yak Master
180 Posts |
Posted - 2010-07-16 : 08:04:39
|
| Hi All, I need one help... i want to select to one UserID column and RoleID from two tables,and i want to display the result it like thisUSERSRole ROLES105-1,106-1,107-1 Manager117-2,118-2 Teamlead1023-3,1056-3,1078-3 engineerbut i am getting like this onlyUSERSRole ROLES105-1,106-1,107-1,117-2,118-2,1023-3,1056-3,1078-3 Manager105-1,106-1,107-1,117-2,118-2,1023-3,1056-3,1078-3 Teamlead105-1,106-1,107-1,117-2,118-2,1023-3,1056-3,1078-3 engineeri have done query like this....DECLARE @Roles_userID VARCHAR(MAX)SELECT @Roles_userID= (COALESCE(@Roles_JournalID+',','')+(COALESCE (CAST(FIS_User.user_id as varchar(25))+'-','')+ (COALESCE (FIS_Roles.role,'')))) FROM FIS_User WITH(NOLOCK) INNER JOIN FIS_Roles WITH(NOLOCK) ON FIS_User.User_ID =FIS_Roles.Created_By group by FIS_User.user_id,FIS_Roles.roleRegards,Divya |
|