I have the following:
SELECT nominees.personname, awards.name as awards, nominees.filmname
FROM nominees, awards WHERE nominees.aid = awards.aid and nominees.personname is not
NULL GROUP BY nominees.personname, awards.name, nominees.filmname
ORDER BY nominees.personname;
This produces the following table:
"personname" "awards" "filmname"
"Ang Lee" "director" "Life of Pi"
"Anglelina J." "actress" "The Tourist"
"Ann Dowd" "supporting actress" "Compliance"
"Anne Hathaway" "actress" "Love and Other Drugs"
"Anne Hathaway" "supporting actress" "Les Misrables"
"Annette Bening" "actress" "The Kids Are All Right"
"Another Year" "screenplay" "Mike Leigh"
"A.R. Rahman" "score" "127 Hours"
"AR Rahman" "score" "127 Hours"
"Barbara Hershey" "supporting actress" "Black Swan"
"Ben Affleck" "actor" "Argo"
"Ben Affleck" "director" "Argo"
I'm attempting to get the set that contains only people who have been nominated for two separate awards for the same movie. In this particular table that is only 'Ben Affleck'.
The results should be
"personname" "awards" "filmname"
"Ben Affleck" "actor" "Argo"
"Ben Affleck" "director" "Argo"
but I can't seem to get that, I've tried using HAVING and some sort of count method, but haven't been able to get that working. Any help is appreciated.