How to SELECT FROM MySQL table in DESCENDING ORDER of a column?
SELECT FROM table in DESCENDING ORDER of a column
When you select rows from a table, you can select those based on the ascending and descending order of the
values in a column.
In this MySQL Tutorial, we shall learn how to select rows of a table based on the descending order of values in
a column.
To sort rows of a result set in descending order of values in a column, use the syntax of the following SQL
Query.
mysql> SELECT *
FROM table_name
ORDER BY
column_name DESC;
mysql> SELECT * FROM table_name ORDER BY column_name DESC;
The character set of the column is considered while sorting the column values in descending order.
Example to sort rows of a table in DESCENDING ORDER of a column¡¯s
values
Consider the following students table.
Now we shall sort these rows in DESCENDING ORDER of name column.
Run the following query to sort the records in descending order.
mysql> SELECT *
FROM students ORDER
BY name DESC;
mysql> SELECT * FROM students ORDER BY name DESC;
Learn MySQL
?
MySQL Tutorial
User Management
?
MySQL Server - Login to mysql Command Line Interface
?
MySQL Server - Get list of All Users
?
MySQL Server - Get list of Connected Users
DATABASE
?
MySQL - Create DATABASE
?
MySQL - Delete DATABASE
?
MySQL - Show existing Databases
?
MySQL - Select or Use DATABASE
TABLE
?
MySQL - Create Table
?
MySQL - Rename Table
?
MySQL - Duplicate a Table
?
MySQL - Add a new Column to Table
?
MySQL - Delete or Drop a Column from MySQL Table
?
MySQL - Select Distinct Values of Column
?
MySQL - Count number of rows in Table
?
MySQL - Increase column size
?
MySQL - Add an AUTO_INCREMENT column as PRIMARY KEY
?
MySQL - Add Column to INDEX
?
MySQL - Delete or Drop Column from INDEX
?
MySQL - SHOW INDEX of Table
?
MySQL - Rename Column or Change Column
Solve Issues
?
MySQL - LAST_INSERT_ID returns 0
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- sql select order by
- relational algebra cse 544 relational operators sorting 1 union and
- example paragraph with descending order
- sql order by multiple columns
- oracle mooc sql fundamentals
- ascending or descending order
- gsort — ascending and descending sort stata
- sql sort group by
- sort statement in sql
- title gsort — ascending and descending sort
Related searches
- how to select a college
- how to select a college or university
- how to quote from a book
- how to select a university
- how to select a research topic
- how to recover from a broken heart
- python how to call from a list
- length of a column in matlab
- how to select columns in r
- how to select random sample in excel
- how to recover from a stroke
- how to select multiple rows in excel