Demo entry 6783947

test

   

Submitted by anonymous on Feb 25, 2019 at 07:19
Language: PostgreSQL console (psql). Code size: 998 Bytes.

select stg_orga_org.id,
stg_orga_org.orgname 分店名,
SUM( stg_acct_busibillfeedtl.feeAmount) 支付宝交易金额
FROM 
 stg_oder_signedorder
 --join stg_user_landlord on stg_user_landlord.id=stg_oder_signedorder.landlordid
 --and stg_user_landlord.curr_source=1
 join stg_orga_org on stg_orga_org.id=stg_oder_signedorder.orgid
 and stg_orga_org.curr_source=1
 and stg_orga_org.status=1
  JOIN stg_acct_busibillfeedtl 
  ON stg_acct_busibillfeedtl.subsid=stg_oder_signedorder.subsid
WHERE 
 stg_acct_busibillfeedtl.billType IN(1003,1004,10015,10008,20001)
AND stg_acct_busibillfeedtl.fundChannel IN(2,13)
AND stg_oder_signedorder.landlordid NOT IN 
 (SELECT stg_user_special.userid FROM stg_user_special WHERE usertype = 0 and curr_source=1)
and stg_oder_signedorder.curr_source=1
and stg_acct_busibillfeedtl.curr_source=1
and date(stg_acct_busibillfeedtl.paytime)>='2018-12-28'
and date(stg_acct_busibillfeedtl.paytime)<'2019-02-01'
and stg_oder_signedorder.landlordid=3124006
group by 1,2

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).