SQLiteMIN语句

SQLiteMIN语句 首页 / SQLite入门教程 / SQLiteMIN语句

SQLite MIN函数用于获取表达式的最小值。

语法:

SELECT MIN(aggregate_expression)
FROM tables
[WHERE conditions]; 

将Min函数与GROUP BY子句一起使用时的语法:

SELECT expression1, expression2, ... expression_n
MIN(aggregate_expression)
FROM tables
[WHERE conditions]
GROUP BY expression1, expression2, ... expression_n; 

示例1:

无涯教程有一个名为" STUDENT"的表,其中包含以下数据:

Sqlite Min function 1

从"STUDENT"表中检索学生的最低费用:

SELECT MIN(FEES) AS "Lowest Fees"
FROM STUDENT; 

链接:https://www.learnfk.comhttps://www.learnfk.com/sqlite/sqlite-min.html

来源:LearnFk无涯教程网

Sqlite Min function 2

示例2:

将GROUP BY子句与MIN函数一起使用:

从表" STUDENT"中检索" NAME"和" MIN FEES",然后按" NAME"的数据进行" ORDER BY"操作:

SELECT NAME, MIN(FEES) AS "Lowest Fees"
FROM STUDENT
WHERE ID <= 5
GROUP BY NAME; 

链接:https://www.learnfk.comhttps://www.learnfk.com/sqlite/sqlite-min.html

来源:LearnFk无涯教程网

Sqlite Min function 3

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

教程推荐

如何落地业务建模 -〔徐昊〕

Python自动化办公实战课 -〔尹会生〕

Go 并发编程实战课 -〔晁岳攀(鸟窝)〕

OAuth 2.0实战课 -〔王新栋〕

TensorFlow 2项目进阶实战 -〔彭靖田〕

视觉笔记入门课 -〔高伟〕

设计模式之美 -〔王争〕

软件工程之美 -〔宝玉〕

数据分析实战45讲 -〔陈旸〕

好记忆不如烂笔头。留下您的足迹吧 :)