Restrictions for using the order by clause.
The maximum number of columns allowed in an order by clause is 400.
You cannot use order by on text, unitext, or image datatype columns.
Subqueries and view definitions cannot include an order by clause (or a compute clause or the keyword into). Conversely, you cannot use a subquery in an order by list.
You cannot update the result set of a server- or language- type cursor if it contains an order by clause in its select statement. For more information about the restrictions applied to updatable cursors, see the Transact-SQL User’s Guide.
order by a, b, c
compute by a, b, c compute by a, b compute by a
You can also use the keyword compute can be used without by to generate grand totals, grand counts, and so on. In this case, order by is optional.