Collections:
Sorting Query Output in Descending Order in SQL Server
How To Sort Query Output in Descending Order in SQL Server?
✍: FYIcenter.com
If you want to sort a column in descending order, you can specify the DESC keyword in the ORDER BY clause. The following SELECT statement first sorts the "tag" in descending order, then sorts the "counts" in ascending order:
SELECT tag, counts, url, created FROM fyi_links ORDER BY tag DESC, counts GO tab counts url created SQA 728 sqa.fyicenter.com 2007-05-19 SQA 828 www.winrunner.com 2003-01-01 DEV 120 dev.fyicenter.com 2006-04-30 DEV 439 www.php.net 2004-01-01 DBA 390 www.mysql.com 2006-01-01 DBA 960 www.oracle.com 2005-01-01 DBA 972 dba.fyicenter.com 2007-05-19
⇒ Counting Rows with the COUNT(*) Function in SQL Server
⇐ Sorting Query Output by Multiple Columns in SQL Server
⇑ Using SELECT Statements and GROUP BY Clauses in SQL Server
2016-10-26, 2041🔥, 0💬
Popular Posts:
How To Update Multiple Rows with One UPDATE Statement in SQL Server? If the WHERE clause in an UPDAT...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to...
How To Start MySQL Server in MySQL? If you want to start the MySQL server, you can run the "mysqld" ...