union 分页问题
(SELECT a FROM tbl_name_a WHERE a=10 AND B=1) UNION (SELECT a FROM tbl_name_b WHERE a=11 AND B=2) ORDER BY a LIMIT 10;
select * from ( select a from tbl_name_a WHERE a=10 AND B=1 union all select a from tbl_name_b WHERE a=10 AND B=1 ) tbl_name order by a limit 0,1;
UNION ALL 不会合并重复的记录
select a,b from tbl_name_a WHERE a=10 AND B=1 union all select a,b from tbl_name_b WHERE a=10 AND B=1
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。