数据统计SQL
来源:互联网 发布:域名放godaddy 编辑:程序博客网 时间:2024/06/05 16:52
-- 查询当前这周的数据
-- ((ticketnumber - salenumber)*ticketactprice)
(100,100)*100
SELECT sum(ticketprice) FROM website_ticket_detail WHERE YEARWEEK(date_format(buytime,'%Y-%m-%d')) = YEARWEEK(now());
-- 查询上周的数据
SELECT name,submittime FROM WEBSITE_TICKET_INFO WHERE YEARWEEK(date_format(startdate,'%Y-%m-%d')) = YEARWEEK(now())-1;
-- 查询当前月份的数据
select * from business_apply where date_format(occurdate,'%Y-%m')=date_format(now(),'%Y-%m');
-- 查询距离当前现在6个月的数据
select name,submittime from enterprise where submittime between date_sub(now(),interval 6 month) and now();
-- 查询上个月的数据
select name,submittime from enterprise where date_format(submittime,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
-- //放款成功数据
select orgid from acct_loan where putoutdate='2017/02/21';
-- //个阶段成功数据
-- businessbelong, "LightAmountFlow", "0010"
-- 2016123000000008
-- 20170222103126429980644569711
select * from BUSINESS_APPLY where serialno="20170222103126429980644569711";
select * from BUSINESS_APPLY o,FLOW_TASK ft
where o.businessbelong="2016123000000008" and o.serialno=ft.objectno and ft.flowno="LightAmountFlow" and ft.phaseno='0010'
and date_format(occurdate,'%Y-%m')=date_format(now(),'%Y-%m');
-- ((ticketnumber - salenumber)*ticketactprice)
(100,100)*100
SELECT sum(ticketprice) FROM website_ticket_detail WHERE YEARWEEK(date_format(buytime,'%Y-%m-%d')) = YEARWEEK(now());
-- 查询上周的数据
SELECT name,submittime FROM WEBSITE_TICKET_INFO WHERE YEARWEEK(date_format(startdate,'%Y-%m-%d')) = YEARWEEK(now())-1;
-- 查询当前月份的数据
select * from business_apply where date_format(occurdate,'%Y-%m')=date_format(now(),'%Y-%m');
-- 查询距离当前现在6个月的数据
select name,submittime from enterprise where submittime between date_sub(now(),interval 6 month) and now();
-- 查询上个月的数据
select name,submittime from enterprise where date_format(submittime,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
-- //放款成功数据
select orgid from acct_loan where putoutdate='2017/02/21';
-- //个阶段成功数据
-- businessbelong, "LightAmountFlow", "0010"
-- 2016123000000008
-- 20170222103126429980644569711
select * from BUSINESS_APPLY where serialno="20170222103126429980644569711";
select * from BUSINESS_APPLY o,FLOW_TASK ft
where o.businessbelong="2016123000000008" and o.serialno=ft.objectno and ft.flowno="LightAmountFlow" and ft.phaseno='0010'
and date_format(occurdate,'%Y-%m')=date_format(now(),'%Y-%m');
0 0
- 数据统计sql语句
- 数据统计SQL
- 经典SQL之数据统计
- sql server数据分组统计
- sql统计当天的数据
- SQL 分组统计 之 同字段不同数据分别统计
- sql数据统计——按时间统计
- 一则数据统计的SQL语句
- sql统计 本期 ,上期 ,去年同期 数据
- 常用的一些数据统计SQL语句
- SQL 五(重复数据、统计)
- SQL Server 按照条件统计雨量数据
- sqlite sql语句 备忘,数据统计
- 常用的数据统计Sql 总结
- SQL统计相同重复的数据
- 常用的数据统计Sql 总结
- 常用的数据统计Sql 总结
- 报表统计 一年每月数据sql
- 桶排序
- 1068依赖服务或组无法启动
- Ubuntu 16.04安装python-igraph
- 【R语言学习笔记】实现类似数据透视表的若干方式
- Calcite中的流式SQL
- 数据统计SQL
- 4种方法让SpringMVC接收多个对象
- 强化学习(Reinforcement learning)是什么?
- 不是每个人都懂得学习要点
- 阿铭带你学linux第五期教程
- __fls 源码分析
- 操作系统之页面置换算法
- 求素数Java实现
- 综合转载文章列表