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

What is the usage of sql max

爱喝马黛茶的安东尼
Release: 2020-01-07 14:47:33
Original
9915 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template