1 : select * from (select * from table1
union all
select * from table1) where id=123
2: select * from table1 where id=123
union all
select * from table1 where id=123
...全文
75114打赏收藏
关于 union的效率
N张表联合查询 把查询条件放在最后还是把条件放在每一个表尾,两种情况那个效率高,还是一样的。, 1 : select * from (select * from table1 union all select * from table1) where id=123 2: select * from table1 where id=123 union all select * from table1 where id=123