Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Can the Query Output Be Sorted by Multiple Columns
Can the Query Output Be Sorted by Multiple Columns? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY
✍: FYIcenter.com
You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value:
mysql> SELECT tag, counts, url, DATE(created) FROM fyi_links ORDER BY tag, counts; +------+--------+-------------------+---------------+ | tag | counts | url | DATE(created) | +------+--------+-------------------+---------------+ | DBA | 1 | www.mysql.com | 2006-01-01 | | DBA | 3 | dba.fyicenter.com | 2006-07-01 | | DBA | 7 | www.oracle.com | 2005-01-01 | | DEV | 4 | dev.fyicenter.com | 2006-04-30 | | DEV | 4 | www.php.net | 2004-01-01 | | SQA | 6 | sqa.fyicenter.com | 2006-07-01 | | SQA | 8 | www.winrunner.com | 2003-01-01 | +------+--------+-------------------+---------------+ 7 rows in set (0.00 sec)
2007-05-11, 4848👍, 0💬
Popular Posts:
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
An application needs to load a library before it starts to run, how to code? One option is to use a ...
What is V model in testing? V model map’s the type of test to the stage of development in a project....
Can you explain project life cycle ? Figure :- 12.2 Life cycle of a project There are five stages of...
How Many Types of Tables Supported by Oracle? - Oracle DBA FAQ - Managing Oracle Database Tables Ora...