Collections:
Sorting Query Output by Multiple Columns in SQL Server
Can the Query Output Be Sorted by Multiple Columns in SQL Server?
✍: FYIcenter.com
You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns rows sorted by "tag" and "counts" values:
SELECT tag, counts, url, created FROM fyi_links ORDER BY tag, counts GO tab counts url created DBA 390 www.mysql.com 2006-01-01 DBA 960 www.oracle.com 2005-01-01 DBA 972 dba.fyicenter.com 2007-05-19 DEV 120 dev.fyicenter.com 2006-04-30 DEV 439 www.php.net 2004-01-01 SQA 728 sqa.fyicenter.com 2007-05-19 SQA 828 www.winrunner.com 2003-01-01
⇒ Sorting Query Output in Descending Order in SQL Server
⇐ Sorting Query Output with ORDER BY Clauses in SQL Server
⇑ Using SELECT Statements and GROUP BY Clauses in SQL Server
2016-10-26, 2000🔥, 0💬
Popular Posts:
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How To Fix the INSERT Command Denied Error in MySQL? The reason for getting the "1142: INSERT comman...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
How To Generate CREATE VIEW Script on an Existing View in SQL Server? If you want to know how an exi...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...