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

Oracle·ÖÎöº¯Êý£¨Í¬±È£¬»·±È£¬Àۼƣ¬»ù±È£©

CREATE TABLE salaryByMonth
(
 employeeNo varchar2(20),
 yearMonth varchar2(6),
 salary number
) ;
insert into SALARYBYMONTH (EMPLOYEENO, YEARMONTH, SALARY)
values (1, '200805', 500);
insert into SALARYBYMONTH (EMPLOYEENO, YEARMONTH, SALARY)
values (1, '200802', 150);
insert into SALARYBYMONTH (EMPLOYEENO, YEARMONTH, SALARY)
values (1, '200803', 200);
insert into SALARYBYMONTH (EMPLOYEENO, YEARMONTH, SALARY)
values (1, '200804', 300);
insert into SALARYBYMONTH (EMPLOYEENO, YEARMONTH, SALARY)
values (1, '200708', 100);
commit;
SELECT EMPLOYEENO
      ,YEARMONTH
      ,SALARY
      ,MIN(SALARY) KEEP(DENSE_RANK FIRST ORDER BY YEARMONTH) OVER(PARTITION BY EMPLOYEENO) FIRST_SALARY -- »ù±È·ÖÎö salary/first_salary
      ,LAG(SALARY, 1, 0) OVER(PARTITION BY EMPLOYEENO ORDER BY YEARMONTH) AS PREV_SAL -- »·±È·ÖÎö£¬ÓëÉϸöÔ·ݽøÐбȽÏ
      ,LAG(SALARY, 12, 0) OVER(PARTITION BY EMPLOYEENO ORDER BY YEARMONTH) AS PREV_12_SAL -- ͬ±È·ÖÎö£¬ÓëÉϸöÄê¶ÈÏàͬÔ·ݽøÐбȽϠ  
      ,SUM(SALARY) OVER(PARTITION BY EMPLOYEENO, SUBSTR(YEARMONTH, 1, 4) ORDER BY YEARMONTH RANGE UNBOUNDED PRECEDING) LJ --ÀÛ¼ÆÖµ
  from SALARYBYMONTH
 ORDER BY EMPLOYEENO
         ,YEARMONTH


Ïà¹ØÎĵµ£º

ORACLE±¸·Ý²ßÂÔ(ORACLE BACKUP STRATEGY)

ORACLE±¸·Ý²ßÂÔ(ORACLE BACKUP STRATEGY)
2007Äê11ÔÂ02ÈÕ ÐÇÆÚÎå 16:03
¸ÅÒª
1¡¢Á˽âʲôÊDZ¸·Ý
2¡¢Á˽ⱸ·ÝµÄÖØÒªÐÔ
3¡¢Àí½âÊý¾Ý¿âµÄÁ½ÖÖÔËÐз½Ê½
4¡¢Àí½â²»Í¬µÄ±¸·Ý·½Ê½¼°ÆäÇø±ð
5¡¢Á˽âÕýÈ·µÄ±¸·Ý²ßÂÔ¼°ÆäºÃ´¦
  
Ò»¡¢Á˽ⱸ·ÝµÄÖØÒªÐÔ
¿ÉÒÔ˵£¬´Ó¼ÆËã»úϵͳ³öÊÀµÄÄÇÌìÆ𣬾ÍÓÐÁ˱¸·ÝÕâ¸ö¸ÅÄ ......

oracle xunhuan

²âÊÔtable
create table table1 (id int,name char)
insert into table1
select 1,'q'
union all select 2,'r'
union all select 3,'3'
union all select 4,'5'
ÒªÇó°´Ö¸¶¨µÄid˳Ðò(±ÈÈç2,1,4,3)ÅÅÁлñÈ¡table1µÄÊý¾Ý
·½·¨1:ʹÓÃunion all,µ«ÊÇÓÐ256ÌõÊý¾ÝµÄÏÞÖÆ
select id,name from table1 where id=2
union al ......

Javaµ÷ÓÃOracle´æ´¢¹ý³Ì


µÚÒ»ÖÖÇé¿ö£ºÎÞ·µ»ØÖµ.
      create or replace procedure test_a(param1 in varchar2,param2 in varchar2) as
       begin
            insert into test value(param1,param2);
  &nb ......

ORACLEÖ®°²×°Æª(Ò») ×¼±¸°²×°

Èí¼þ: VMware Workstation 6.0.2 build-59824
        10201_database_linux32.zip
        rhel.5.0.server.centoschina.com.dvd.iso
Îĵµ:ORACLE10G¹Ù·½°²×°Îĵµ  B19306_01_Oracle10gR2.chm
²Î¿¼:Öܾ¼ÀÏʦµÄORACLE10G OCPÊÓƵ(½²µÄÕæµÄ ......

oracle½â³öËÀËøµÄ°ì·¨

1£ºÒÔÒ»¸öDBAÉí·ÖµÄÓû§µÇ½£¬´ò¿ªÒ»¸öÃüÁî´°¿Ú¡£Ö´ÐÐÃüÁî
SELECT /*+ rule */ s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
from v$session s,v$lock l,dba_objects o
WHERE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ