zoukankan      html  css  js  c++  java
  • 投资统计查询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'

  • 相关阅读:
    Spring3:AOP
    Spring2:bean的使用
    Spring1:Spring简介、环境搭建、源码下载及导入MyEclipse
    Vue.js——60分钟组件快速入门(上篇)
    vue父子组件嵌套的时候遇到
    Vue.js——60分钟快速入门
    [Vue warn]: Cannot find element: #app
    关于RabbitMQ以及RabbitMQ和Spring的整合
    spring集成多个rabbitMQ
    RabbitMQ-从基础到实战(5)— 消息的交换(下)
  • 原文地址:https://www.cnblogs.com/zxtceq/p/5703743.html
Copyright © 2011-2022 走看看