代码如下:
$sql3="CREATE TEMPORARY TABLE atmp_table(uid int(11),dnum int(20) not null)";
MysqL_query($sql3);
$sql3="INSERT into atmp_table(uid,dnum) SELECT uid,count(soid) as dnum
FROM `cy_score2`
where (nei='下载' or nei='下载试题')
group by uid having dnum>150
order by dnum desc limit 10";
MysqL_query($sql3);
$sql3="select a.uid,count(b.tid) as unum from atmp_table a left join cy_test b on a.uid=b.uid
group by b.uid
order by a.dnum desc,unum asc limit 5";
$query4=MysqL_query($sql3);
$rs=MysqL_fetch_array($query4) ;
MysqL_query($sql3);
$sql3="INSERT into atmp_table(uid,dnum) SELECT uid,count(soid) as dnum
FROM `cy_score2`
where (nei='下载' or nei='下载试题')
group by uid having dnum>150
order by dnum desc limit 10";
MysqL_query($sql3);
$sql3="select a.uid,count(b.tid) as unum from atmp_table a left join cy_test b on a.uid=b.uid
group by b.uid
order by a.dnum desc,unum asc limit 5";
$query4=MysqL_query($sql3);
$rs=MysqL_fetch_array($query4) ;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。