Home  >  Article  >  Database  >  What does order mean?

What does order mean?

little bottle
little bottleOriginal
2019-05-21 13:54:0627665browse

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.

What does order mean?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn