oracle怎么查临时表,Oracle查询问题引发临时表使用

分析某段时间内,刷卡金额大于1000的卡的消费记录,写法如下。

SQL语句写法:select a.dno,  a.dcard, a.dcard_money, a.dcard_type, a.ddate,        a.dsubshop, a.dworker,  a.dtype, j.Djf Dnowjf, b.dsje, B.Dcount

from st_card_salemx a,

( select m.dcard, Count(1) Dcount, Sum(dcard_money) dsje

from st_Card_Salemx m

where ddate >= to_Date('2016-7-17', 'yyyy-mm-dd')

and Ddate <= to_Date('2016-7-19', 'yyyy-mm-dd')

and dcard_type <> '06'

group by m.dcard

having Sum(dcard_money) >= 1000 ) b , st_card_jf j

where a.dcard = b.dcard and b.dcard = j.dcardno

and a.ddate >= to_Date('2016-7-17', 'yyyy-mm-dd')

and a.Ddate <= to_Date('2016-7-19', 'yyyy-mm-dd')

order by 2

问题:刚开始使用的时候,3分钟可以出结果,用了一年以后,40分钟都还没有出结果。Dcard是

你可能感兴趣的:(oracle怎么查临时表)