Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎÊ´ð£º

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



type Exception report


message

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

exception

org.apache.jas ......

javaÔõôÁ¬½ÓOracle£¬¼±°¡ - Java / JavaÏà¹Ø

private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
private static final String USERNAME = "sys";
private static final String PASSWORD = "s ......

oracleÓëaix - Oracle / ¸ß¼¶¼¼Êõ

ÔÚϵͳÔËÐеÄʱºò×ÜÊÇÓÐÒ»¿é´ÅÅÌʼÖÕÉÁºìµÆ£¬½øÈëϵͳºó
#topas²é¿´×ÜÊÇÓÐÒ»¿é´ÅÅÌ%BUSYΪ90%ÒÔÉÏ£¬
Êý¾Ý¿â°æ±¾£ºoracle 9.2.0.7 
Êý¾ÝÎļþ¹ÒÔØµÄ½Úµã£º/oradata/pcs/ Âß¼­¾íºÅlv04 
#lslv -l lv04 ......

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 / ......

oracleµÄ°²×°ºÍʹÓúÃÄѰ¡ - Java / Java EE

oracleµÄ°²×°ºÍʹÓö¼ºÜÄÑÂð£¿Ô­À´Ê²Ã´¶¼²»»áʱѧÁËMySQL£¬Ò²Ã»Ôõôѧ¹ý£¬¾Í×Ô¼º×°¼¸´Î£¬Óü¸Ï£¬¾Í´ïµ½ÁË´óÌåÄÜʹÓõij̶ÈÁË£¬¿ÉÊÇoracleµ½ÏÖÔÚ²»»á×°²»»áÓ㬲»»áÅ䣬ÎÒ¾ÍÏë×°¸öoracle£¬È»ºó½¨¸öÊý¾Ý¿â£¬ÀïÃæÓм¸Õ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ