insert into tmp_usr_card_qty(user_id,qty)
select
/*+ index(mt_cards idx_mt_card_crtdt) */
user_id,count(0) qty
from mcard.mt_cards c
where c.card_createtime between 1371571200 and 1371657600
group by user_id
執行計畫如下:
而**:
select
/*+ index(mt_cards idx_mt_card_crtdt) */
user_id,count(card_id) qty
from mcard.mt_cards
where card_createtime >= 1371571200
group by user_id
的執行計畫是:
經反覆分析,原因是在hint 中,使用了表別名,經修改**如下後,得到了所要的結果。
insert into tmp_usr_card_qty(user_id,qty)
select
/*+ index(c idx_mt_card_crtdt) */
user_id,count(card_id) qty
from mcard.mt_cards c
where c.card_createtime between 1371571200 and 1371657600
group by user_id
Linq 中查詢乙個表中指定的字段
linq中查詢乙個表中指定的幾個字段 var ts t.findallitems where p p.companyid cursiteuser.companyid select s new distinct tolist orderbydescending s s.billperiod take ...
乙個修改檔案中指定內容的程式
下面是乙個修改檔案中指定內容的程式,這裡面主要用到了以下幾個函式 file fopen const char path,const char mode size t fread void buffer,size t size,size t count,file stream buffer 用於接收資...
Linq中查詢乙個表中指定的幾個字段
var ts t.findallitems where p p.companyid cursiteuser.companyid select s new distinct tolist orderbydescending s s.billperiod take 24 findallitems 為查詢...