sql statement order by usage

order by is after where conditions for query results sort

    order by field name asc / desc  

    asc for ascending (the default is asc, can be omitted)

    desc for descending

order by sub-query can not be used, otherwise it will error: Unless It also specifies the TOP or FOR XML, otherwise, ORDER BY clause queries and common table expressions is invalid in views, inline functions, derived tables, child.

Original link: https: //blog.csdn.net/m0_37894254/article/details/80675980

Guess you like

Origin www.cnblogs.com/liang715200/p/12034981.html