Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Õâ¸öSQLÓï¾äÔõôд? - Oracle / »ù´¡ºÍ¹ÜÀí

Õâ¸öSQLÓï¾äÔõôд?
ÏÖÔÚÓÐÒ»¸ö±íT,ÀïÃæ¾Í3¸ö×Ö¶Î
ѧÉúID(sid)¿Î³Ì(cName)³É¼¨(score)
1 1 75
2 2 90
3 2 60
4 3 89
5 3 80
6 3 70
ÎÒÏÖÔÚÏëÖªµÀµÃµ½µÄ½á¹ûÊÇ:ÿÃſγÌÅÅÔÚǰÁ½ÃûµÄѧÉúµÄID,Ó¦¸ÃÔõÃ´Ð´ÄØ?
SQL code:

select k.*
from (select sid,
cname,
score,
rank() over(partition by cname order by score desc) rn
from t) k
where k.rn <= 2



SQL code:
select m.* from
(
select t.* , row_number() over(partition by cName order by score desc) px from tb t
) m
where px <= 2

select m.* from
(
select t.* , (select count(1) from tb where cName = t.cName and score > t.score) + 1 from tb t
) m
where px <= 2


select id,cname from 
  (select id,cname,rank () over (partition by cname order by score desc) rk
  from t)
where rk<=2;

SQL code:

SQL>
SQL> with t as (
2 select 1 sid, 1 cname, 75 score from dual union all
3 select 2, 2, 90 from dual union all
4 select 3, 2, 60 from dual union all
5 select 4, 3, 89 from dual union all


Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

oracle·þÎñ״̬ÏÔʾ ¡°Í£Ö¹¡±

ÎÒÊÇÓÃÔ¶³Ì×ÀÃæÁ¬²Ù×÷·þÎñÆ÷ÉϵÄÊý¾Ý¿â¡£
ÔÚ´´½¨Ò»¸öÓû§Ö®ºó£¬ÔÙÓÃPLSQLµÇ¼£¬ÔòPLSQLËÀµôÁË¡£
ÎҹصôPLSQLÖ®ºó£¬ÓÃÆäËûÓû§Ò²²»ÄܵǼ¡£

ÎÒ°ÑoracleµÄ·þÎñÍ£Ö¹£¬½á¹û¾ÍÊÇoracleµÄ·þÎñ״̬¾ÍÍ£ÁôÔÚ¡°Í ......

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

oracle °²×° 01092 ´íÎó - Oracle / »ù´¡ºÍ¹ÜÀí

oracle 11g °²×° 01092 ´íÎó,
ÈÕÖ¾ÐÅÏ¢£º
[oracle@linux trace]$ vi alert_orcl.log 
MMON started with pid=14, OS id=9089
RESETLOGS after incomplete recovery UNTIL CHANGE 522752
Errors in file / ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ