WebThe basic syntax of the ORDER BY clause is as follows − SELECT column-list FROM table_name [WHERE condition] [ORDER BY column1, column2, .. columnN] [ASC DESC]; You can use more than one column in the ORDER BY clause. Make sure whatever column you are using to sort that column should be in the column-list. Example WebMar 23, 2024 · Specifying ascending and descending sort order A. Specifying a descending order. The following example orders the result set by the numeric column ProductID in …
Select, Order by -ASC & DESC, Distinct Clause, Nulls First & Nulls …
WebAbout Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ... WebTo sort customer by name alphabetically in descending order, you explicitly use DESC after the column name in the ORDER BY clause as follows: SELECT name, address, credit_limit FROM customers ORDER BY name DESC; The following picture shows the result that customers sorted by names alphabetically in descending order: pay wellington rates online
ORDER BY Clause - Microsoft Support
WebThe ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in … WebSep 15, 2024 · In a query expression, the orderby clause causes the returned sequence or subsequence (group) to be sorted in either ascending or descending order. Multiple keys can be specified in order to perform one or more secondary sort operations. The sorting is performed by the default comparer for the type of the element. WebFeb 5, 2024 · You use the order by keyword in select statements to order the data that is returned. Use the index hint keyword to specify the index that should be used in the query, and to sort the selected records in the manner that is defined by the index. Indexes optimize the selection of records. scripts that work