方法很简单,就是在普通 create 语句里加上TEMPORARY 指定TYPE=HEAP,这里指内存表。
如:
create TEMPORARY table temp_qeesoo_id TYPE=HEAP
select a.customer_id from t_prehandle_qeesoo_05 a where
a.start_time BETWEEN '2008-05-28' and '2008-05-29' and a.record_status=0
group by a.customer_id;
create TEMPORARY table temp_qeesoo_id2 TYPE=HEAP
select aa.customer_Id from t_accounts aa where aa.product_Id=102;
select t.customer_id,c.customerName,d.name,e.realityName from temp_qeesoo_id2 as t , TCustomerBaseInfo as c, TDepartment as
d,TCustomerService as e
where t.customer_Id not IN
(
select * from temp_qeesoo_id
)
and c.csId=e.id and e.department_id=d.department_id and t.customer_id=c.customerId;
|
%E4%B8%AD%E7%9A%84%E4%B8%B4%E6%97%B6%E8%A1%A8&oldid=89005
阅读(2356) | 评论(0) | 转发(0) |