MySQL Forums
Forum List  »  Optimizer & Parser

what's the execution order of each part of a sql query
Posted by: aaron chan
Date: February 19, 2019 09:00PM

What's the execution order of each part of a sql query,like SELECT、DISTINCT、FROM、WHERE、GROUP BY、ORDER BY···

I searched a large number of sites said that ORDER BY executes after SELECT,if this is true,a simple query like 'select column1 from table1 order by column2' should not execute because after executing SELECT,there is only column1 in the dataset,it can't use column2 to sort the dataset. But actually it works!

Options: ReplyQuote


Subject
Views
Written By
Posted
what's the execution order of each part of a sql query
45
February 19, 2019 09:00PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.