日期:2014-05-16  浏览次数:21038 次

为什么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