I have these tables:
- Member (IdMember, name, nbFollower)
- Follower (IdMember, IdFollower, date)
- Friend (IdMember, IdFriend)
- Photo (IdPhoto, datePhoto, IdMember)
- Comment (IdPhoto, IdMember, no, content)
- Like (IdPhoto, IdMember)
no is the order of comment written by a member on a photo
I want to select the name of the members who left more than 3 comments on the same photo.
I did this but it doesn't work:
SELECT name
FROM MEMBER M, COMMENT C, PHOTO P
WHERE M.IdMember = C.IdMember = P.IdMember
AND M.IdMember IN (SELECT IdMember
FROM COMMENT
GROUP BY IdMember
HAVING COUNT(no) >= 3)
How can I change my query?
JOINsyntax in the ANSI-92 SQL Standard (25 years ago) and its use is discouraged