1) SELECT
2) FROM
3) JOIN
4) ON
5) WHERE
6) GROUP BY
7) HAVING
8) ORDER BY
9) LIMIT
Join을 하는 경우 WHERE은 JOIN ~ ON 뒤에 사용되니 주의하기.
1) FROM and JOINs
2) WHERE
3) GROUP BY
4) HAVING
5) SELECT
6) DISTINCT
7) ORDER BY
8) LIMIT / OFFSET
출처:
https://mode.com/sql-tutorial/sql-having/
https://sqlbolt.com/lesson/select_queries_order_of_execution