0

我正在尝试合并 2 个具有相同字段的表(具有相同的 varchar 大小/int 大小等)

但是在浏览器中我得到了斑点......

select * from
(
select * from (
SELECT media.id,ifnull(wasRead,0) as wasRead
,teamid,newsDate,itemid
,var1,var2,var3,var4,title,content
,ifnull(optionSel,0) as optionSel,0 as itemType
FROM media
left join mediaList on mediaList.id = media.itemId
where teamid = '1') as media

union all

select * from (
select managerNews.id,ifnull(wasRead,0) as wasRead
,teamid,newsDate,itemid
,var1,var2,var3,var4,title,content
,ifnull(optionSel,0) as optionSel,0 as itemType
from managerNews
left join managerNewsList on managerNewsList.id = managerNews.itemId
where teamid = 1) as managerNews
) as merged

order by newsDate desc
limit 50

我只是不知道该怎么办。

提前致谢。

4

1 回答 1

0

好吧,在那一行有不同的排序规则。太奇怪了,我看错了,但终于解决了。

谢谢 :-)

于 2013-05-06T17:30:37.373 回答