May 21, 2010 at 10:30 am
I've tried searching this site, because I know people have made reference to this. The closest I could come with BOL was the following (but this is incomplete):
Processing Order of WHERE, GROUP BY, and HAVING Clauses
The following steps show the processing order for a SELECT statement with a WHERE clause, a GROUP BY clause, and a HAVING clause:
1 The FROM clause returns an initial result set.
2 The WHERE clause excludes rows not meeting its search condition.
3 The GROUP BY clause collects the selected rows into one group for each unique value in the GROUP BY clause.
4 Aggregate functions specified in the select list calculate summary values for each group.
5 The HAVING clause additionally excludes rows not meeting its search condition.
May 21, 2010 at 10:46 am
yep, what you posted matches what i have in my snippets, captured from some other post on the same subject:
The main clauses in SQL are logically executed in the following order:
FROM (including JOINS)
WHERE
GROUP BY
HAVING
SELECT
DISTINCT
ORDER BY
TOP
Lowell
May 21, 2010 at 12:37 pm
Thanks, Lowell, that's helpful.
Julie
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply