Chinaunix首页 | 论坛 | 博客
  • 博客访问: 635604
  • 博文数量: 137
  • 博客积分: 6189
  • 博客等级: 准将
  • 技术积分: 1559
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-15 16:39
文章分类

全部博文(137)

文章存档

2010年(3)

2009年(1)

2008年(49)

2007年(56)

2006年(28)

分类: LINUX

2008-05-30 17:29:50

方法很简单,就是在普通 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
阅读(2322) | 评论(0) | 转发(0) |
0

上一篇:Mysqldump 用法

下一篇:pb中setFilter详解

给主人留下些什么吧!~~