我建了一个临时表,然后向其中插入了记录当我需要在这个临时表上自连接运算的时候,提示can't reopen table:'a'请问错误在哪里啊?以下是我的临时表:CREATE TEMPORARY TABLE test
(
partition varchar(2) not null,
ID bigint not null,
BeginTime datetime not null,
EndTime datetime not null
) type = HEAP ;报错语句:select * from test a inner join test b
on a.begintime<b.endtime ;
(
partition varchar(2) not null,
ID bigint not null,
BeginTime datetime not null,
EndTime datetime not null
) type = HEAP ;报错语句:select * from test a inner join test b
on a.begintime<b.endtime ;
解决方案 »
- Lost connection to MySQL server at 'reading initial communication packet'
- 这两个表怎么计算库存
- 有二张主从表,我想更新从表记录,改如何实现呢
- [求助]网页游戏数字主键问题
- 关于tag查询的问题,请各位指教一下!
- 急!~关于更改参照关系删除元组策略遇到的问题
- 在MYSQL中,如何实现字段的关联?
- 谁有MySQL的讲义 或者简介 powerpoint 档案的(送400分)
- 全文检索(jsp+mysql)
- 菜鸟向各位高手们求一段sql代码
- 急!Linux下pg_dump的参数“-D”为何不好使啊?
- 请问一个数据库设计问题,希望能保证一致性的同时,保证查询速度
引擎类型只能是:memory(heap)、myisam、merge、innodb
不支持mysql cluster
同一个查询语句中只能引用一次! 如 SELECT * FROM TP_TABLE , TP_TABLE AS ALIAS_NAME; 是错误的
同一个用户存储函数中只能引用一次!
show tables 不会显示临时表
不能使用rename重命名临时表。只能使用ALTER TABLE OLD_TP_TABLE_NAME RENAME NEW_TP_TABLE_NAME;
影响使用replication功能
我的目标是查询出这段时间内是否有时间重叠,不用连接怎么查?
请高手指教。实际查询代码:select count(*) into result from test a inner join test b
on a.begintime<b.endtime and a.endtime>b.begintime ;
CREATE TABLE test
(
partition varchar(2) not null,
ID bigint not null,
BeginTime datetime not null,
EndTime datetime not null
) ;
CREATE TABLE test
(
partition varchar(2) not null,
ID bigint not null,
BeginTime datetime not null,
EndTime datetime not null
) type = HEAP ;用完后,自己把表DROP掉。
这个要看你的具体实际情况,缓冲内存参数的设置,查询语句的内容和执行次序时间。 比如一个语句你今天执行了一下,然后又执行了上万个不同的SQL语句,你再来执行这个语句,90%的情况下,重要重新分析执行。
(
partition varchar(2) not null,
ID bigint not null,
BeginTime datetime not null,
EndTime datetime not null
) type = HEAP ;并不会创建磁盘上的数据文件。