3.1 明细查询
SQL 语句示例:
1)select * from fine_record_execute
2)select tname, displayName, consume from fine_record_execute
3.2 group by 查询
GROUP BY 查询,有 SUM,COUNT,MAX,MIN,AVERAVG 这五种聚合方式,如果什么都不写,会默认 COUNT
SQL 语句示例:
1)select sum(consume) from fine_record_execute group by tname, displayName
2)select consume from fine_record_execute group by tname, displayName
3)select min(consume), max(consume) from fine_record_execute group by tname, displayName
3.3 where 过滤条件
简单的 WHERE 过滤条件,支持 AND,OR,=,<>,>,>=,
SQL 语句示例:
1)select * from fine_record_execute where consume > 10
2)select sum(consume) from fine_record_execute where consume > 10 and consume < 100 group by tname, displayName
3)select consume from fine_record_execute where tname = `doc/Advanced/Chart/GraphSwitching/多图表实现统一切换.frm`
4)select sum(consume) from fine_record_execute where tname in (`doc/Advanced/Chart/GraphSwitching/多图表实现统一切换.frm`, `doc/Advanced/Chart/Combination/柱形-面积组合图.cpt`) group by tname, displayName
3.4 todate() 将时间戳转换为普通的日期类型
todate() 结果的日期格式为:2018-12-18 10:15:26
SQL 语句示例:
1) select todate(time) from fine_record_execute
2) select * from fine_record_execute where todate(time)'2018-12-17 10:15:26'
注: 需要更新 2019-05-20 以后的 JAR。
3.5 like 模糊查询
只支持前后‘%’的用法
注1:支持使用 like 进行模糊查询,不支持 not like 用法 。
注2:目前只支持 '%',暂不支持通配符 ‘_’,需要更新 2019-05-20 以后的 JAR。
SQL 语句示例:
1)select * from fine_record_execute where tname like '%demo%'