14. Структура и порядок выполнения предложения Select в SQL
Как выглядит SELECT
sql
SELECT [DISTINCT | ALL] { * | [ColumsExpression [AS NewName], ... ] }
FROM TableName [AS NewName]
[ { INNER | LEFTOUTER | FULL } JOIN ] TasbeName2 [AS NewName]
ON condition ]
[ WHERE condition ]
[ GROUP BY ColumnList ]
[ HAVING condition ]
[ ORDER BY ColumnList [ ASC | DESC ]]
Последовательность выполнения SELECT
FROM
JOIN ... ON
WHERE
GROUP BY
HAVING
SELECT
DISTINCT
ORDER BY