$sql = 'SELECT * FROM 表1 UNION SELECT * FROM 表2' . ' WHERE articleid = ' . intval($this->id) . ' ORDER BY chapterorder ASC' ;
换成UNION ALL也不行,会叠加在一起
水平分表
$sql = 'SELECT * FROM 表1 UNION SELECT * FROM 表2' . ' WHERE articleid = ' . intval($this->id) . ' ORDER BY chapterorder ASC' ;
换成UNION ALL也不行,会叠加在一起
水平分表
具体是要获得什么样的结果?
select * from (
select * from 表1
union all
select * from 表2
) where articleid='intval($this->id)'
order by chapterorder ASC;