Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
You can sort query results in ascending or descending order on one or more of the columns in the result set by using the ASC or DESC keywords with the ORDER BY
clause.
Note
The sort order is determined in part by the column's collation sequence. You can change the collation sequence in the Collation dialog box.
The following procedure assumes that you have a query open in Query and View Designer that uses the ORDER BY
clause to sort one or more columns.
Specify or change the order in which results are sorted
In the Criteria Pane (Visual Database Tools), select the Sort Type field for the column that you want to reorder.
Choose Ascending or Descending to specify the sort order for the column.
As you work in the Criteria pane, your query's UNION
clause changes to match your most recent actions.
Note
When sorting results by more than one column, specify the order in which columns are searched relative to each other by using the Sort Order column. For more information, see Sort multiple columns in queries (Visual Database Tools).