Consider the following SQL:
SELECT mov
FROM movie
WHERE mov IN
(
SELECT mov
FROM movie_star
GROUP BY(mov)
HAVING count(star) > 6
)
INNER JOIN movie_star
ON movie_star.mov = movie.mov;
I am getting the following error when this query is executed:
.ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ‘inner join movie_star on movie_star.mov =
movie.mov’ at line 3
The
JOINhas to go before theWHEREclause.