真的没有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但愿可以对你有帮助。
解决方案 »
- 关联表的删改,大家是怎么处理的?
- MySQL数据库返回的DataTable表头乱码问题。。
- 有没有办法可以在改变一列数据的同时自动改变另一列数据
- 关于MYsql proxy read_query 注入sql的问题
- 求助:mysql光用用户名能进,使用用户名加密码就无法登陆。
- 关于mysql数据库操作日志查看的问题
- 求救:在MySQL中不能使用IN子查询
- bigint中的字段长度设为20有问题
- mysql存储过程和触发器的问题,来挑战一下吧~
- 关于delete与updata语句中嵌套的使用问题
- mysql中如何改数据文件的存放的目录.默认在/usr/local/share/var下
- MYSQL远程连接怎么配置
有两种可行的方案:
第一种:执行多个select 查询,每个表执行一个。如果不关心所选出的次序,这样就解决了。
第二种:将每个表中的行选入一个临时存储表,然后选怎改表的内容。这样可以按行对所序的次序排列。具体实现语句是 Reve(仨仁仕) 回答的。
那怎么做那?