电影院数据修改

,a.agentDz,a.agentDd,a.agentStaticJf,a.agentSaleJf,a.agentDynamicProfit,a.agentStaticProfit,a.agentRebuy

电子币 点点币 静态积分 销售积分 静态收益 动态收益 复消币

00523C58 . BA 043F5200 mov edx,Resume.00523F04 ; benz4bmw3leo3
00523D09 . BA 2C3F5200 mov edx,Resume.00523F2C ; mtx3cmts4mtx3

会员资料 member_member
会员详细资料 member_account
会员交易明细 member_daybook

会员卡内余额 member_dalysum

错误的!!!!
select sum(balance) from (
select m.*,a.balance,a.accountno from MEM_MEMBER m,MEM_ACCOUNT a where m.MEMBERNO = a.MEMBERNO and a.ACCOUNTNO in
(select ACCOUNTNO from (
select * from (
select ACCOUNTNO,tracedate from MEM_DAYBOOK group BY ACCOUNTNO,tracedate HAVING COUNT(ACCOUNTNO) = 1 ORDER BY ACCOUNTNO )
where tracedate > '2018-07-01'))) where balance <100 ;

select sum(balance) from (
select m.,a. from MEM_MEMBER m,MEM_ACCOUNT a where m.MEMBERNO = a.MEMBERNO and a.ACCOUNTNO in
(select ACCOUNTNO from (
select * from (
select ACCOUNTNO,tracedate from MEM_DAYBOOK group BY ACCOUNTNO,tracedate HAVING COUNT(ACCOUNTNO) = 1 ORDER BY tracedate desc)
where tracedate < '2018-07-01'))) where balance <26 ;

select * from (
select m.*,a.balance,a.accountno,b.traceno,b.tracedate from MEM_MEMBER m,MEM_ACCOUNT a ,mem_daybook b where m.MEMBERNO = a.MEMBERNO and b.accountno= a.accountno ) group BY ACCOUNTNO,tracedate HAVING COUNT(ACCOUNTNO) = 1 ORDER BY tracedate desc;

有消费数据的用户:
select * from(
select m.,a.,tracedate from MEM_MEMBER m,MEM_ACCOUNT a,

(select t1.*
from mem_daybook t1
join
(
SELECT max(traceno) as traceno
FROM mem_daybook
GROUP BY ACCOUNTNO
) t2 on t1.traceno = t2.traceno and t1.tracedate < '2018-07-01' order by ACCOUNTNO ) t1

where m.MEMBERNO = a.MEMBERNO and t1.accountno = a.accountno and tracedate < '2018-07-01'

) where tracedate < '2018-07-01'

无消费数据的用户:

select m.,a. from MEM_MEMBER m,MEM_ACCOUNT a where m.MEMBERNO = a.MEMBERNO and a.ACCOUNTNO not in
(select accountno
from mem_daybook t1
join
(
SELECT max(traceno) as traceno
FROM mem_daybook
GROUP BY ACCOUNTNO
) t2 on t1.traceno = t2.traceno order by ACCOUNTNO )

select t1.*
from mem_daybook t1
join
(
SELECT max(traceno) as traceno
FROM mem_daybook
GROUP BY ACCOUNTNO
) t2 on t1.traceno = t2.traceno order by ACCOUNTNO

select * from mem_daybook where accountno = 00000003

select m.,a.,b.* from (MEM_MEMBER as m left join MEM_ACCOUNT as a on m.MEMBERNO = a.MEMBERNO) left join mem_daybook as b on a.accountno = b.accountno where b.traceno in
(select traceno from (
select * from (
select ACCOUNTNO,tracedate,traceno from MEM_DAYBOOK group BY ACCOUNTNO,tracedate,traceno HAVING COUNT(ACCOUNTNO) = 1 ORDER BY tracedate desc) as t1
) as t2 )

select * from mem_daybook a where (select count(*) from mem_daybook b where a.traceno=b.traceno and b.tracedate>a.tracedate) < 3 order by a.cat_id,a.value desc;

posted @ 2021-02-02 21:41  张扬86  阅读(1)  评论(0编辑  收藏  举报
baidu