linux查询log 报表,报表日志 LogDB 数据库

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%'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值