Hello,
I have three Tables tblUsers tblPictures and tblPictureRating
On my site the photographers can rate other photographers work, what I'm trying to to do is filter out the photographs that a user may have voted on, but for the life of me I'm struggling can you help here is the SQL that I'm using:
SELECT dbo.tblPictures.PictureID, dbo.tblUsers.OwnerUsername, dbo.tblPictures.PictureName, dbo.tblPictureRating.UserName
FROM dbo.tblUsers INNER JOIN
dbo.tblPictures ON dbo.tblUsers.OwnerID = dbo.tblPictures.OwnerID INNER JOIN
dbo.tblPictureRating ON dbo.tblPictures.PictureID = dbo.tblPictureRating.PictureID
WHERE (dbo.tblPictureRating.UserName = N'jonpanky')
GROUP BY dbo.tblUsers.OwnerUsername, dbo.tblPictures.PictureName, dbo.tblPictures.PictureID, dbo.tblPictureRating.UserName
HAVING (dbo.tblUsers.OwnerUsername <> N'jonpanky')
ORDER BY dbo.tblPictures.PictureID
Thanks if you can help me.
Regards
Jon
I have three Tables tblUsers tblPictures and tblPictureRating
On my site the photographers can rate other photographers work, what I'm trying to to do is filter out the photographs that a user may have voted on, but for the life of me I'm struggling can you help here is the SQL that I'm using:
SELECT dbo.tblPictures.PictureID, dbo.tblUsers.OwnerUsername, dbo.tblPictures.PictureName, dbo.tblPictureRating.UserName
FROM dbo.tblUsers INNER JOIN
dbo.tblPictures ON dbo.tblUsers.OwnerID = dbo.tblPictures.OwnerID INNER JOIN
dbo.tblPictureRating ON dbo.tblPictures.PictureID = dbo.tblPictureRating.PictureID
WHERE (dbo.tblPictureRating.UserName = N'jonpanky')
GROUP BY dbo.tblUsers.OwnerUsername, dbo.tblPictures.PictureName, dbo.tblPictures.PictureID, dbo.tblPictureRating.UserName
HAVING (dbo.tblUsers.OwnerUsername <> N'jonpanky')
ORDER BY dbo.tblPictures.PictureID
Thanks if you can help me.
Regards
Jon