真的没有union(至少3.*没有)。
可以通过允许服务器创建存储表来解决这个问题。而且可以使该表为临时表,以便服务器的会话结束后,自动删除该表。
为了更好的性能,可以利用HEAP(在内存中)表。creat temporary table hold_tb1 type=heap select ... from table1 where ...
insert into hold_tbl select ... from table2 where ...
insert into hold_tbl select ... from table3 where ...
...
select * from hold_tb1 order by ...
drop table hold_tb1对于3.23版本,除了必须自己明确定义hold_tb1表中的例外,其想法是类似的,而且结尾处的drop table是强制的,用来防止客户机生命周期之后继续存在:create table hold_tb1(column1 ...,column2 ..., ...) type=heap select ... from table1 where ...
insert into hold_tbl select ... from table1 where ...
insert into hold_tbl select ... from table2 where ...
insert into hold_tbl select ... from table3 where ...
select * from hold_tb1 order by ...
drop table hold_tb1但愿可以对你有帮助。
可以通过允许服务器创建存储表来解决这个问题。而且可以使该表为临时表,以便服务器的会话结束后,自动删除该表。
为了更好的性能,可以利用HEAP(在内存中)表。creat temporary table hold_tb1 type=heap select ... from table1 where ...
insert into hold_tbl select ... from table2 where ...
insert into hold_tbl select ... from table3 where ...
...
select * from hold_tb1 order by ...
drop table hold_tb1对于3.23版本,除了必须自己明确定义hold_tb1表中的例外,其想法是类似的,而且结尾处的drop table是强制的,用来防止客户机生命周期之后继续存在:create table hold_tb1(column1 ...,column2 ..., ...) type=heap select ... from table1 where ...
insert into hold_tbl select ... from table1 where ...
insert into hold_tbl select ... from table2 where ...
insert into hold_tbl select ... from table3 where ...
select * from hold_tb1 order by ...
drop table hold_tb1但愿可以对你有帮助。
解决方案 »
- access转mysql的问题
- 真怪了,-- 在存储过程不能注释吗?为何用 -- 注释会报错呢?(/* */可以用,但是 -- 为何不能用呢?)
- Mysql 查询出生日期为最近7天sql.
- char型的字段无法用where进行限制查询,在线等。
- 有人知道MySQL 5 的报价吗?
- 菜鸟.请问各位一下,在mysql 中两字段字符相加出现的问题.?????
- 从来就没有解决过的问题。
- mysql update 和硬盘关系
- mysql 插入报错#1105 - Too long comment for table 'kc'
- mysql 数字类型
- mysql中如何改数据文件的存放的目录.默认在/usr/local/share/var下
- MYSQL远程连接怎么配置
有两种可行的方案:
第一种:执行多个select 查询,每个表执行一个。如果不关心所选出的次序,这样就解决了。
第二种:将每个表中的行选入一个临时存储表,然后选怎改表的内容。这样可以按行对所序的次序排列。具体实现语句是 Reve(仨仁仕) 回答的。
那怎么做那?