Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The following query qorks beautifully, taking all rows of results into a comma-delimited string:
- declare @data varchar(8000)
- select @data = coalesce(@data + ',','') + CAST(p.title AS VARCHAR(50))
- from adminPermission p
- INNER JOIN adminUserPermissionAssoc a
- ON p.id = a.adminPermissionID
- WHERE a.adminUserID = 2
- select @data
- My isue comes in when I want that query ran as a subquery of this query (it would be placed in the parentheses in the select list)
- SELECT
- u.id as adminID,
- u.fullName as fullName,
- (
- ) as permissionGroups
- FROM
- adminUser u
- WHERE
- u.username = 'psawhney'
- AND u.password = 'a8eaf1d74dc182ad4f9ff4b775dae756'
- Does anyone know how to accomplish this?
Add Comment
Please, Sign In to add comment