快速入门
安装
基本操作
数据模型
SQL引擎
系统架构
数据库管理
连接器
驱动
参考手册
故障排除
SAC
版本信息
聚集函数
用于返回记录中,指定字段名的最大值。
max(<field_name>) as <alias_name>
参数名 | 参数类型 | 描述 | 是否必填 |
---|---|---|---|
field_name | string | 字段名。 | 是 |
alias_name | string | 别名。 | 是 |
Note:
- 使用 max 函数返回字段的最大值时,必须使用别名。
指定字段在记录中的最大值。
集合 foo.bar 中原始记录。
{a:0, b:2} {a:1, b:2} {a:2, b:3} {a:3, b:3}
返回集合 foo.bar 中 a 字段的最大值。
> db.exec("select max(a) as 最大值 from foo.bar") { "最大值": 3 } Return 1 row(s). Takes 0.5155s.