MySQL - Sorting Results
Sorting query results is re-arranging the rows returned from a query result set either in ascending or descending order. The DESC keyword is used to sort the query result set in a descending order. The ASC keyword is used to sort the query result set in an ascending order.
Syntax :
SELECT <field1, field2,...>
FROM <table_name>
ORDER BY <field1, field2,...> ASC|DESC
Example :
SELECT StudentName,StudentClass
FROM studentinfo
ORDER BY StudentName,StudentClass ASC
The result will be displayed as follows:
(As we noticed Names are ordered according to ascending order of alphabets)
StudentName | Studentclass |
---|---|
Ajaashi | tenth |
manju | sixth |
Manjusha | sixth |
Meherish | sixth |
Noothan | sixth |
Sahayana | sixth |
Sweekrutha | sixth |
MySQL - Grant_ Revoke Privilege
posted on 2019-11-26 23:15:04 - mysql Tutorials
how to use range in golang
posted on 2022-05-03 08:28:11 - Go lang Tutorials
find variable type in golang
posted on 2022-05-03 05:24:55 - Go lang Tutorials