zoukankan      html  css  js  c++  java
  • --投资情况统计详情sql


    --投资情况统计详情sql
    select BidRecord.*, RegInfo.UserName,UserInfo.phone,BorrowInfo.Title,BorrowInfo.BorrowCode from
    --(select * from [YYD_Account_MoneyRecord] where moneytype='参与投标' and state=1) as MoneyRecord
    (select * from YYD_Borrow_BidRecord where status=1 and
    borrow_id in(select borrow_id from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_product<>50)) as BidRecord

    left join
    (select * from YYD_Users_RegInfo) as RegInfo
    on BidRecord.bid_user_id=RegInfo.ID
    left join
    (select * from YYD_Users_UserInfo) as UserInfo
    on BidRecord.bid_user_id=UserInfo.user_id
    left join
    (select * from YYD_Borrow_BorrowInfo) as BorrowInfo
    on BidRecord.borrow_id= BorrowInfo.ID
    where Convert(varchar(10),BidRecord.createtime,120)='2016-07-11'
    and (BorrowInfo.Title like '%%' or BorrowInfo.BorrowCode like '%%')
    union
    select BidRecord.*, RegInfo.UserName,UserInfo.phone,BorrowInfo.bTitle+'['+BorrowInfo.qishu+']','' from
    --(select * from [YYD_Account_MoneyRecord] where moneytype ='加入计划' and state=1) as MoneyRecord
    (select * from YYD_Borrow_BidRecord where status=1 and
    borrow_id in(select borrow_id from YYD_Borrow_borrowinfo_ext as ext where ext.borrow_product<>50)) as BidRecord

    left join
    (select * from YYD_Users_RegInfo) as RegInfo
    on BidRecord.bid_user_id=RegInfo.ID
    left join
    (select * from YYD_Users_UserInfo) as UserInfo
    on BidRecord.bid_user_id=UserInfo.user_id
    left join
    (select * from HUR_NewPlanLoan) as BorrowInfo
    on BidRecord.borrow_id= BorrowInfo.ID
    where Convert(varchar(10),BidRecord.createtime,120)='2016-07-11'
    and (BorrowInfo.bTitle+'['+BorrowInfo.qishu+']' like '%%')
    order by createtime desc

  • 相关阅读:
    spark 随意笔记
    c#读取输入字符串,从数据源中查找以该字符串开头的所有字符串(使用正则表达式)
    我的收藏链接地址
    SQL查询时,遇到用到关键词作的字段。将该字段用一对中括号括起来[]
    SQL数据类型相互转换
    Javascript获取系统当前时间
    节点类型nodeType的取值
    混合布局编程挑战
    Webstorm破解方法
    二列布局
  • 原文地址:https://www.cnblogs.com/zxtceq/p/5703750.html
Copyright © 2011-2022 走看看