Not the answer you need?
Register and ask your own question!

what's the execution order of each part of a sql query

aaron1989041aaron1989041 EntrantInactive User Role Novice
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!
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.