合并两张表,LIMIT 查询 本帖最后由 cxc3787582 于 2012-09-28 17:44:19 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from (select name as n ,null as t ,id ,sex from aunion allselect lastname,titile,tid,null from b) tlimit 30 将2张表UNION ALL即可需要用 LIMIT 分页?详细说明 SELECT * FROM (SELECT name as n,null as t,id ,sex FROM aUNION ALL SELECT lastname,title,tid,null FROM b)mLIMIT 30; select * from (select name as n ,null as t ,id ,sex from aunion allselect lastname,titile,tid,null from b) tlimit 30,10; MYSQL 如何实现数据分行,求教+ mysql if语句怎么写 MySql。。语句问题。。。。。。。 关于相关性问题的讨论 查询问题,大家帮忙看看 这两种做法哪个更好? mysql 启动错误 1067 如何加快 mysql 的数据插入 mysql win编译 MYSQL安装配置时,服务器启动不了 mysql 生成随机数 问问大侠门 请教SQL问题
select name as n ,null as t ,id ,sex from a
union all
select lastname,titile,tid,null from b
) t
limit 30
(SELECT name as n,null as t,id ,sex FROM a
UNION ALL
SELECT lastname,title,tid,null FROM b
)m
LIMIT 30;
select name as n ,null as t ,id ,sex from a
union all
select lastname,titile,tid,null from b
) t
limit 30,10;