And for those of you that care... This is how you do it:

SELECT DISTINCT Role.Rolename, a.userid
FROM Role LEFT OUTER JOIN
  (
    SELECT UserRole.Roleid, UserRole.Userid
    FROM UserRole
    WHERE UserRole.userid = 84  
  ) as a ON Role.roleID = a.roleId
WHERE Role.ApplicationID = 39

You have to add in a sub-query and effectively call it a table with all of
the data in for that user and do a left outer join on it!

The sub-query/table has only 3 values, and is joined on the roleid.

HTH

Paul
-------------------------------------------
Paul Johnston
PJ Net Solutions Ltd
http://www.pjnetsolutions.com
[EMAIL PROTECTED]
+44 (0)7866 573013




-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to