Is order by clause allowed in a subquery

前端 未结 9 1537
离开以前
离开以前 2020-12-10 14:34

Is there any reason why or why not you should do an \'order by\' in a subquery?

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 15:34

    Depending on the size of the sub-query, it will impact performance to a varrying degree.

    Order shouldn't matter on a sub-query though. You should be able to move the Order By portion to the Outer Query (which should be the one returning the final results).

提交回复
热议问题