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
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协议包
- load data infile有没有能够替代insert into ... on duplicat key update `c`=`c`+`1的方法?
- 误删info.frm文件后,如何删除重建info表!
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gb2312_chinese_ci,错误
- 一个Hibernate一对多产生的问题
- mysql中的打印语句(输出语句)是什么?
- [求助]linux中mysqld进程占cpu99????
- 如何将sql语句的执行结果转换成*.sql文件
- 首先憎恨mysql.市井公司滩涂便宜带来的愁苦. 怎么从一个表里查出其中一列不包含另一表一列的值的最大值.
- mysql在linux下安装的问题,谢谢。
- 我把linux下的mysql文件夹拷贝了下来,想在windows下的mysql上恢复数据
- mysql多表删除 快点 再快点....
union all
select * from A.right join B on A.id=B.id