## 聚合查询
>[info]统计数据
~~~
db.name('user').count()
~~~
~~~
db.name('user').count('id')
~~~
>[info]获取最大值
~~~
db.name('user').max('balance')
~~~
>[info]获取最小值
~~~
db.name('user').min('balance')
~~~
>[info]获取平均值
~~~
db.name('user').avg('balance')
~~~
>[info]获取总和
~~~
db.name('user').sum('balance')
~~~
- 连接数据库
- 链式操作方法
- distinct
- field
- withoutField
- name
- alias
- force
- join
- leftJoin
- rightJoin
- union
- unionAll
- where
- whereOr
- whereTime
- whereBetweenTime
- whereNotBetweenTime
- whereBetweenTimeField
- whereNotBetweenTimeField
- whereYear
- whereMonth
- whereWeek
- whereDay
- group
- having
- order
- orderRand
- limit
- page
- lock
- comment
- ignore
- inc
- dec
- fetchSql
- 查询数据
- 聚合查询
- 新增数据
- 更新数据
- 删除数据
- 原生操作