sql min函数
Hello there! In this tutorial, we are going to discuss the use and working of the SQL min() and max() functions.
你好! 在本教程中,我们将讨论SQL min()和max()函数的使用和工作。
So let us get right into the topic.
因此,让我们直接进入主题。
SQL MIN()函数 (SQL MIN() Function)
The SQL min()
function is used to find the minimum/lowest value in the given column. The syntax for using the function is given below.
SQL min()
函数用于在给定列中查找最小值/最小值 。 下面给出了使用该函数的语法。
SELECT MIN(column)
FROM Table
WHERE condition;
Where, column
and Table
are the column name and table name respectively for which we need to find the minimum value. The WHERE
condition is used to narrow down the set of values on the basis of the condition
.
其中, column
和Table
分别是我们需要查找最小值的列名和表名。 的WHERE
条件用于缩小的设定值的基础上condition
。
Let us look at an example to get a better understanding.
让我们看一个例子,以更好地理解。
Example: The table below contains the score of 3 different students in 3 different subjects(Maths, Science, and English) out of 100.
示例 :下表包含3个不同学科在3个不同学科(