Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT ALLTABLE.Viewer_ID " +
- "FROM (SELECT A.Viewer_ID, A.Movie_ID, B.myID, B.myMovies " +
- "FROM Watched A LEFT JOIN (SELECT Viewer_ID AS myID, Movie_ID AS myMovies FROM Watched WHERE Viewer_ID = ?) B " +
- "ON (Viewer_ID != myID AND Movie_ID = myMovies) " +
- "GROUP BY A.Viewer_ID, A.Movie_ID, B.myID, B.myMovies " +
- "ORDER BY Viewer_ID ASC" +
- ") AS ALLTABLE " +
- "GROUP BY ALLTABLE.Viewer_ID " +
- "HAVING COUNT(ALLTABLE.Viewer_ID) > (SELECT Movie_ID FROM Watched WHERE Viewer_ID = ?)*(3/4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement