Mysql is a relational database. It has many keywords for users to use to manipulate data. For example, I will introduce order to you today. Its expression in mysql is generally order by.
When you use the SELECT statement to query data from a table, the result set is not sorted in any order. To sort the result set, use the ORDER BY clause. The ORDER BY clause allows you to:
Sort the result set by a single column or multiple columns.
Sort the result set by different columns in ascending or descending order.
The following introduces the syntax of the ORDER BY clause:
SELECT column1, column2,... FROM tbl ORDER BY column1 [ASC|DESC], column2 [ASC|DESC],...
ASC represents ascending order, and DESC represents descending order. If no collation is specified, the order by clause sorts the result set in ascending order by default.
Related learning recommendations: mysql tutorial(video)
The above is the detailed content of What does order mean?. For more information, please follow other related articles on the PHP Chinese website!