select id,time,max(id) keep(dense_rank last order by count(*)) ×î´óid from tb where time between t1 and t2 group by id,time
select max(id) from tb where time =ijһʱ¼ä select id,time from ( select id,count(id) num,time from table where time = 'ijһʱ¼ä' group by time,id order by num desc ) where rownum =1; select id from ( select id,count(id) num,time from table where time = 'ijһʱ¼ä' group by time,id order by num desc ) where rownum =1; SQL code:
--Ç°ÃæµÄÐÞÕýÏ SQL> edi ÒÑдÈë file afiedt.buf
1 select max(id) keep(dense_rank last order by count(*)) 2 from tb 3 where time ='201009' 4* group by id SQL> /
ÓÃPL/SQL µÇ½ʱµ¯³ö±¨´í´°¿Ú£¬´íÎóÈçÏ£¡ ORA-01034:ORACLE not available ORA-27101:shared memory realm does not exist ÇëÎÊ£¬ÓÐûÓÐÈËÓöµ½ÕâÖÖÇé¿ö£¬Ôõô½â¾ö£¿Ð»Ð»£¡