完整SQL语句
SELECT DISTINCT <column_list>FROM <table_name_1><join_type> JOIN <table_name_2> ON <join_condition>WHERE <where_codition>GROUP BY <group_by_list>HAVING <having_condition>ORDER BY <order_by_condition>LIMIT {[offset,] row_count | row_count OFFSET offset_num}
SQL 执行顺序
- FROM
- ON
JOIN - WHERE
- GROUP BY
- SELECT DISTINCT
- ORDER BY
- LIMIT {[offset,] row_count | row_count OFFSET offset_num}
