Re: [SQL ] sql 子查詢 過久無反應

看板Database (資料庫)作者 (T大)時間14年前 (2012/03/29 08:57), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《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
文章代碼(AID): #1FSxE9CF (Database)
文章代碼(AID): #1FSxE9CF (Database)