--Details of investment statistics SQL

Source: Internet
Author: User


--Details of investment statistics SQL
Select bidrecord.*, Reginfo.username,userinfo.phone,borrowinfo.title,borrowinfo.borrowcode from
--(SELECT * from [Yyd_account_moneyrecord] where moneytype= ' participate in bidding ' 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 ' percent ' or borrowinfo.borrowcode like '% ')
Union
Select bidrecord.*, reginfo.username,userinfo.phone,borrowinfo.btitle+ ' [' +borrowinfo.qishu+ '] ', ' from
--(SELECT * from [Yyd_account_moneyrecord] where moneytype = ' join plan ' and state=1) as Moneyrecord
(SELECT * from Yyd_b Orrow_bidrecord where Status=1 and
borrow_id in (select borrow_id from Yyd_borrow_borrowinfo_ext as ext where Ext.borro W_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 (), bidrecord.createtime,120) = ' 2016-07-11 '
and (Borrowinfo.btitle+ ' [' +borrowinfo.qishu+ '] ' like '% ')
ORDER BY createtime Desc

--Details of investment statistics SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.