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 2005 Forums
 Transact-SQL (2005)
 sql query problem

Author  Topic 

keyursoni85
Posting Yak Master

233 Posts

Posted - 2008-05-09 : 03:30:51
Select j.AdminID, g.groupname from Admins j
LEFT OUTER JOIN dbo.AdminGroup AS jg ON j.AdminID = jg.AdminID
INNER JOIN [Group] AS g ON g.GroupId = jg.GroupId
WHERE (j.isDeleted = 0) AND ISNULL(j.IsSystemUser,0) = 0

Result of above query
---------------------
AdminID groupname
--------------------------
6 PS
6 Admins
4 PS2
28 PSR
28 Admins
26 Admins


I want output like this...
------------------------

---------------------
AdminID groupname
--------------------------
6 PS, Admins
4 PS2
28 PSR, Admins
26 Admins

Please help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-09 : 03:43:47
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53293


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-05-09 : 04:59:08
Also see http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

keyursoni85
Posting Yak Master

233 Posts

Posted - 2008-05-09 : 11:23:04
thank you all
Go to Top of Page
   

- Advertisement -