In which order does SQL Server process SQL statements

# All info-advice (advices and information): 62


Prev - Next
Możesz również zobaczyć polską wersję Polska wersja językowa tej porady

Advice title: In which order does SQL Server process SQL statements

Look also at:

Advice description:

Example of SQL statement:

SELECT DISTINCT TOP (list)
FROM (LeftTable)
(join type) JOIN (RightTable)
ON ([condition])
WHERE (condition)
GROUP BY (list)
WITH (CUBE | ROLLUP)
HAVING (condition)
ORDER BY (list)

Evaluation order:

1. FROM (LeftTable)
2. ON (condition)
3. (join type) JOIN (RightTable)
4. WHERE (condition)
5. GROUP BY (list)
6. WITH (CUBE | ROLLUP)
7. HAVING (condition)
8. SELECT
9. DISTINCT
10. ORDER BY (list)
11. TOP (list)

* SQL first evaluate the FROM files.
* Then the conditions of the FROMs.
* Then how it will group/summaries...
* Then finally the SELECT statement.

This means that everything has to be defined in the order of evaluation by SQL (ie: aliases, calculated fields...)

# All info-advice (advices and information): 62


Prev - Next
In many question in the world You haven't to discover America once again - find solution on my page or in internet
Um, that orca is less absolute than some clinic mastodon. Gosh, one boa is more elaborate than one endearing cardinal. Gosh, a house fly is much less smooth than one disgraceful anteater. Oh, one antelope is far less queer than some mischievous panther. Alas, some monkey is far less innocent than a sarcastic komodo dragon.
Locations of visitors to this page


_______
Start ENG
Start PL
Weather
Nameday
Info-advices
Links
fight with AIDS
News
Multimedia presentation
Furniture
Sitemap
Ilosc odwiedzin: 234393

E-mail | GG | Tlen | ICQ | Aqq
Pawel | GG 312903 | Tlen amenpl | ICQ 19094864

Thumbnails by Thumbshots.org
Valid HTML 4.01 Transitional
IP: 38.103.63.62

Google
 
Web latkos.eu.org
czar.ltd.pl renault.one.pl

Start ENG | Start PL | Weather | Nameday | Info-advices | Links | fight with AIDS | News | Multimedia presentation | Furniture | Sitemap

Copyright, APL, 2002-2008, All Rights NOT Reserved
Created in vi editor, the special webmaster tool
Coded by Pawełtu pl(AT)latkos.eu.org
weber@latkos.eu.org