首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

为什么full join 会报错?而right(left) join没有关问题?

2012-10-16 
为什么full join 会报错?而right(left) join没问题?在线等。。。select * from (SELECT agency_id,username,

为什么full join 会报错?而right(left) join没问题?在线等。。。
select * from (
SELECT agency_id,username, count( authorid ) AS num,sum(replynum ) as replynum
FROM `agencypartreply`
WHERE replynum >4
AND countdate > UNIX_TIMESTAMP( '2012-09-01' )
AND countdate < UNIX_TIMESTAMP( '2012-11-01' )
GROUP BY username
) as a 
FULL JOIN 
agencyuser as u on u.id = a.agency_id where a.num > 21


[解决办法]
因为mysql没有full join这个东西

你只能写成

sleect * from A left join B on A.id=B.id
union all
select * from A.right join B on A.id=B.id

热点排行