Home >Database >SQL >What is the usage of sql max

What is the usage of sql max

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2020-01-07 14:47:339957browse

What is the usage of sql max

MAX() function

The MAX function returns the maximum value in a column. NULL values ​​are not included in the calculation.

SQL MAX() Syntax

SELECT MAX(column_name) FROM table_name

Note: MIN and MAX can also be used with text columns to obtain the highest or lowest value in alphabetical order.

SQL MAX() Example

We have the following "Orders" table:

What is the usage of sql max

Now, we Want to find the maximum value of the "OrderPrice" column.

We use the following SQL statement:

SELECT MAX(OrderPrice) AS LargestOrderPrice FROM Orders

The result set is similar to this:

What is the usage of sql max

PHP Chinese website, there are a lot of free SQL tutorial, everyone is welcome to learn!

The above is the detailed content of What is the usage of sql max. 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

Related articles

See more