|
Posted by Plamen Ratchev on 01/31/08 02:54
"SirCodesALot" <sjourdan@gmail.com> wrote in message
news:20a0a9bd-c8b1-4437-a601-40f1280ee966@u10g2000prn.googlegroups.com...
>
> Select Disctinct UserInfo.Title, Webs.Title, WebGroups.Title from
DISTINCT is misspelled.
> Userinfo
> INNER JOIN WebGruopMembers
Above table name seems misspelled.
> ON UserInfo.MemberID = WebGroupMember.MemberID
> INNER JOIN WebGroups
> ON Webgroups.WebId = WebGroupMember.WebID
> INNER JOIN Webs
> ON WebGroups.WebId = WebGroups.WebID
Above join is incorrectly referencing the same column, it should be the
column from the other table.
> WHERE WebGroups.Title = "Admin"
>
Here is the query a bit cleaned:
SELECT DISTINCT U.Title,
W.Title,
G.Title
FROM WebGroups AS G
JOIN WebGroupMembers AS M
ON G.WebID = M.WebID
JOIN Webs AS W
ON G.WebID = W.WebID
JOIN UserInfo AS U
ON M.MemberID = U.MemberID
WHERE G.Title = 'Admin'
HTH,
Plamen Ratchev
http://www.SQLStudio.com
Navigation:
[Reply to this message]
|