关于asp中如何选取数据库中相同记录的前两条 表中有检查人jcrxm,检查时段jcsd,检查日期jcrq等等,如何按人名进行检查次数的统计,然后选取前两条记录显示出来 用select count(*) from JCXS_INFO where jcrq between to_date() and to_date() and jcsd like "%" 大概就是这个语句,请教高手指点
------解决方案--------------------
SQL code
select * from (select jcrxm, count(jcrxm) as cnt from JCXS_INFO where (jcrq between ? and ?) and jcsd like ? group by jcrxm order by cnt desc) t where t.rownum <= 2
------解决方案--------------------