Development · Uncategorized

Logical Query Processing Order in SQL Server

Hi friends,

Today in this blog I will tell you guys about the logical query processing order in SQL Server. SQL Server process the query in a certain order which is known as Logical query processing order.

We generally write the query in this order:

1. SELECT

2. FROM

3. WHERE

4. GROUP BY

5. HAVING

6. ORDER BY

But SQL Server doesn’t process the query in same order. It will get executed in this order:

1. FROM

2. ON

3. OUTER

4. WHERE

5. GROUP BY

6. CUBE | ROLLUP

7. HAVING

8. SELECT

9. DISTINCT

10. ORDER BY

11. TOP

Hope you guys like this post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s