What's the execute order of the different parts of a SQL select statement?

前端 未结 3 1960
猫巷女王i
猫巷女王i 2020-12-01 11:38

What\'s the execute order of the different parts of a SQL select statement? Such as
distinct
from
order by
group by
having
multiline function(count,

3条回答
  •  渐次进展
    2020-12-01 11:50

    The above answer addresses the question but there is one exception to the above mentioned order

    when you have

    select top n ............

    order by

    Then, order by will be executed before select. ( the entries are ordered first and then the top n entries are selected)

提交回复
热议问题