投资统计查询sql
select COUNT(*) from YYD_Users_RegInfo where regTime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
union all select COUNT(*) from YYD_Users_RegInfo where regTime between '1980-01-01' and '2016-07-11 23:59:59'
union all select sum(amount) from YYD_Account_MoneyRecord
where (moneytype='充值' or moneytype='线下充值' ) and state=1 and paytime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
union all select sum(amount) from [YYD_Account_MoneyRecord]
where (moneytype='充值' or moneytype='线下充值' ) and state=1 and paytime between '1980-01-01' and '2016-07-11 23:59:59'
--投资金额(当日)
--union all select sum(amount) from [YYD_Account_MoneyRecord]
--where moneytype in('参与投标','加入计划') and state=1 and createtime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
union all select SUM(amount) from YYD_Borrow_BidRecord where status=1
and createtime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
and borrow_id in(select borrow_id from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_product<>50)
--投资金额(总累计)
--union all select sum(amount) from [YYD_Account_MoneyRecord]
--where moneytype in('参与投标','加入计划') and state=1 and createtime between '1980-01-01' and '2016-07-11 23:59:59'
union all select SUM(amount) from YYD_Borrow_BidRecord where status=1 and
createtime between '1980-01-01' and '2016-07-11 23:59:59'
and borrow_id in(select borrow_id from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_product<>50)
union all select sum(amount) from [YYD_Account_MoneyRecord]
where (moneytype='提现' or moneytype='线下提现') and state=1 and paytime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
union all select sum(amount) from [YYD_Account_MoneyRecord]
where (moneytype='提现' or moneytype='线下提现') and state=1 and paytime between '1980-01-01' and '2016-07-11 23:59:59'
union all select sum(USableAmount) from [YYD_Account_AccountInfo]
--首充数量(当天)
union all select COUNT(*) from YYD_Users_RegInfo
where ID in(select distinct user_id from YYD_Account_RechargeRecord where amount>0 and state=1)
and regTime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
--累计充值人数
union all select COUNT(*) from YYD_Users_RegInfo
where regTime between '1980-01-01' and '2016-07-11 23:59:59' and
ID in(select distinct user_id from YYD_Account_RechargeRecord where amount>0 and state=1)
--充值人数(当天)
union all select COUNT(*) from YYD_Account_RechargeRecord where amount>0 and state=1
and createtime between '2016-07-11 00:00:00' and '2016-07-11 23:59:59'
投资统计查询sql的更多相关文章
- 统计查询-sql
select --总注册人数(select COUNT(*) from [YYD_Users_RegInfo]) as TotalCount,--pc端注册人数(select COUNT(*) fro ...
- 电Call记录统计查询sql
DECLARE @startTime datetimeset @startTime='2016-07-12' SELECT * FROM (--坐席号/电话个数/通话总时长select zuoxi a ...
- Thinkphp查询 1.查询方式 2.表达式查询 3.快捷查询 4.区间查询 5.组合查询 6.统计查询 7.动态查询 8.SQL 查询
1.使用字符串作为条件查询 $user = M('User'); var_dump($user->where('id=1 AND user="蜡笔小新"')->sele ...
- [原创]java WEB学习笔记92:Hibernate学习之路-- -QBC 检索和本地 SQL 检索:基本的QBC 查询,带 AND 和 OR 的QBC,统计查询,排序,分页
本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...
- --投资情况统计详情sql
--投资情况统计详情sqlselect BidRecord.*, RegInfo.UserName,UserInfo.phone,BorrowInfo.Title,BorrowInfo.BorrowC ...
- mysql统计类似SQL语句查询次数
mysql统计类似SQL语句查询次数 vc-mysql-sniffer 工具抓取的sql分析. 1.先用shell脚本把所有enter符号替换为null,再根据语句前后的字符分隔语句 grep -Ev ...
- SQL Fundamentals: 分组统计查询(FROM-WHERE-GROUPBY-HAVING-SELECT-ORDER BY)
SQL Fundamentals || Oracle SQL语言 统计函数 单字段分组统计(GROUP BY) 多字段分组统计 HAVING子句 控制操作的显示列:基本的SELECT语句 控制行:限定 ...
- mysql按年度、季度、月度、周、日统计查询的sql语句
本文介绍一些mysql中用于查询的sql语句,包括按年度.季度.月度.周.日统计查询等,有需要的朋友,可以参考下. 一.年度查询 查询 本年度的数据 SELECT * FROM blog_arti ...
- thinkphp区间查询、统计查询、SQL直接查询
区间查询 $data['id']=array(array('gt',4),array('lt',10));//默认关系是(and)并且的关系 //SELECT * FROM `tp_user` WHE ...
随机推荐
- Monkey学习(3)如何在Android模拟器中安装apk
1.运行SDK Manager,选择模拟器,并运行模拟器,我这里用的是已经配置好的模拟器“RedMI” 2.已启动好的模拟器“RedMI” 3.记住需要安装apk文件的位置,我这里放在了F盘的根目录下 ...
- python中的实例方法、静态方法、类方法、类变量和实例变量
class MyTest: myname = 'peter' # add a instance attribute def __init__(self, name): self.n ...
- linux 多线程信号处理总结
linux 多线程信号总结(一) 1. 在多线程环境下,产生的信号是传递给整个进程的,一般而言,所有线程都有机会收到这个信号,进程在收到信号的的线程上下文执行信号处理函数,具体是哪个线程执行的难以获知 ...
- 发现easyui-accordion一个bug,在ie6、ie7不兼容性问题
当设置全局css文件单元格样式为下面时 td{ word-break: break-all; word-wrap: break-word;} easyui-accordion在ie6.ie7上面会出现 ...
- css3中的过渡(transition)
css3 transition(过渡)1.语法: transition:[ transition-property ] || [ transition-duration ] || [ transiti ...
- [Selenium] 根据预期的日期格式,获取昨天的日期
我们不必考虑当前时间是否是本月1号,"MM/dd/yyyy"日期格式可以更改.
- Hbase之更新单条数据
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; impo ...
- 2016年GitHub排名前20的Python机器学习开源项目(转)
当今时代,开源是创新和技术快速发展的核心.本文来自 KDnuggets 的年度盘点,介绍了 2016 年排名前 20 的 Python 机器学习开源项目,在介绍的同时也会做一些有趣的分析以及谈一谈它们 ...
- 在centos6.5中安装reids
一.简介 Redis是一个key-value存储系统,是一个内存数据库,Redis的出现,很大程度补偿了memcached这类key/value存储的不足,在部 分场合可以对关系数据库起到很好的补充作 ...
- 能源项目xml文件标签释义--DataSource
<bean id="dataSource1" class="org.apache.tomcat.jdbc.pool.DataSource" destroy ...