sql select語法執行順序

zyh_1988發表於2020-12-09

select 語法的處理順序

FROM
ON
JOIN
WHERE
GROUP BY
WITH CUBE or WITH ROLLUP
HAVING
SELECT
DISTINCT
ORDER BY
TOP

注意 join 可以將where 新增放到 on 中,left join 中where條件無法放到on中,儘量 先篩選再left join

相關文章