这个sql关键字的意思是把两个select的结果合并到一个临时表中,unionall的效率高于union,因为union自带去重,unionall是把所有的结果集都显示
用法举例如下
select name from 表名 where id=条件 union select 要查询的条件 from 表名 where 限制条件
这个sql关键字的意思是把两个select的结果合并到一个临时表中,unionall的效率高于union,因为union自带去重,unionall是把所有的结果集都显示
用法举例如下
select name from 表名 where id=条件 union select 要查询的条件 from 表名 where 限制条件