Re: [SQL ] sql 子查詢 過久無反應
※ 引述《tracy217 (T大)》之銘言
: ;with temp_aaa as
: (
: select ID
: FROM table
: where date BETWEEN '20000101' AND '20031231'
: Except
: select ID
: from table
: where func_date BETWEEN '19960101' AND '19991231'
: )
: select count(distinct id ) as id_cnt
: ,date
: from table as a
: where exists (select 1 from temp_aaa b where a.id = b.id )
and date BETWEEN '20000101' AND '20031231'
: group by date
: 這樣寫呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.228.2
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
3
10
Database 近期熱門文章
PTT數位生活區 即時熱門文章