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

Oracle È¡µÃµ±Ìì0ʱ0·Ö0ÃëºÍ23ʱ59·Ö59Ãë

--È¡µÃµ±Ìì0ʱ0·Ö0Ãë
select TRUNC(SYSDATE) from dual;
--È¡µÃµ±Ìì23ʱ59·Ö59Ãë(ÔÚµ±Ìì0ʱ0·Ö0ÃëµÄ»ù´¡ÉϼÓ1ÌìºóÔÙ¼õ1Ãë)
SELECT TRUNC(SYSDATE)+1-1/86400 from dual;
--È¡µÃµ±Ç°ÈÕÆÚÊÇÒ»¸öÐÇÆÚÖеĵڼ¸Ìì,×¢Ò⣺ÐÇÆÚÈÕÊǵÚÒ»Ìì
select to_char(sysdate,'D'),to_char(sysdate,'DAY') from dual;
--ÔÚoracleÖÐÈçºÎµÃµ½µ±ÌìÔ·ݵĵÚÒ»ÌìºÍ×îºóÒ»Ìì
select to_char(sysdate,'yyyy-mm')||'-01' firstday,to_char(last_day(sysdate),'yyyy-mm-dd') lastday from dual
--ʵÏÖµ±Ìì16µãÇ°Êý¾Ý¼õÈ¥×òÌì16µãµÄ£¬¹ýÁË16µã¼õÈ¥½ñÌì16µã
select field1, field2 from mytable
where time = decode(sign(sysdate-trunc(sysdate)-16/24), --ʱ¼äÅжÏ
-1,trunc(sysdate)-1+16/24, --СÓÚ16µãÈ¡×òÌì16µã
trunc(sysdate)+16/24) --´óÓÚ16µãÈ¡µ±Ìì16µã
Ïà¹ØÔĶÁ£ºOracle ÖÐµÄ TO_DATE ºÍ TO_CHAR º¯Êý
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }


Ïà¹ØÎĵµ£º

µ±ORACLE¹éµµÈÕÖ¾ÂúºóÈçºÎÕýȷɾ³ý¹éµµÈÕÖ¾

µ±ORACLE ¹éµµÈÕÖ¾ÂúÁ˺󣬽«ÎÞ·¨Õý³£µÇÈëORACLE£¬ÐèҪɾ³ýÒ»²¿·Ö¹éµµÈÕÖ¾²ÅÄÜÕý³£µÇÈëORACLE¡£
Ò»¡¢Ê×ÏÈɾ³ý¹éµµÈÕÖ¾ÎïÀíÎļþ£¬¹éµµÈÕÖ¾Ò»°ã¶¼ÊÇλÓÚarchiveĿ¼Ï£¬AIXϵͳÏÂÎļþ¸ñʽΪ“1_17884_667758186.dbf”£¬½¨Òé²Ù×÷Ç°ÏȶÔÊý¾Ý¿â½øÐб¸·Ý£¬É¾³ýʱÖÁÉÙ±£Áô×î½ü¼¸ÌìµÄÈÕÖ¾ÓÃÓÚÊý¾Ý¿â»Ö¸´¡£
¶þ¡¢°Ñ¹éµµÈÕ ......

oracleʹÓÃ×Ó²éѯ²åÈëºÍÐÞ¸ÄÊý¾Ý

ʹÓÃ×Ó²éѯ²åÈëÊý¾Ý£º
ʾÀýÒ»£ºinsert into employee (empno,ename,sal,deptno)
           select empno,ename,sal,deptno from emp
          where deptno=20;
ʾÀý¶þ£ºinsert /*+APPEND*/ into employee (empno,e ......

oracleÊÂÎñ´¦Àí

1.»ØÍËÊÂÎñ
×îºÃÉèÖÃÒ»¸ö±£´æµã£¬Àýsavepoint a,»òÕßÖ´ÐÐ exec dbms_transaction.savepoint('a')(Ö´ÐÐÇ°ÐèÒªÖ´ÐÐset serveroutput onÓï¾ä)£»È¡Ïû²¿·ÖÊÂÎñ¾Í¿ÉÒÔʹÓÃrollback to a,»òÕßÖ´ÐÐexec dbms_transaction.rollback_savepoint('a');È¡ÏûÈ«²¿ÊÂÎñ¿ÉÒÔÖ´ÐÐrollback,»òÕßexec dbms_transaction.rollback;
2.Ö»¶ÁÊÂÎñ
......

DB2ºÍORACLEµÄÓ¡Ïó±È½Ï

Ò»¸öÏîÄ¿ÐèÒªDB2£¬ÒÔǰûÓùý£¬ÓÃÁËWINDOWS 2008ϵÄDB29.7 ºÃ¼¸ÖÜ£¬ËãÈëÃÅÁË°É£¬ÏÂÃæÕâÎÄÕ¾͵±Ò»¸öORACLEʹÓÃÕßÑÛÀïµÄDB2µÄÓ¡Ïó°É£¬Ò²ÐíÓÐЩ¶«Î÷¿ÉÄÜÓÐÆ«²î£¬µ«ÊǾÍÊÇÎÒ×Ô¼ºµÄÓ¡Ïó£º
1¡¢Ìåϵ½á¹¹£¬DB2µÄʵÀýºÍÊý¾Ý¿â·Ö¿ªµÄ×ö·¨£¬ÎÒ¸öÈË»¹ÊDZȽÏϲ»¶µÄ£¬ÒòΪʵÀý¿ÉÒÔ´´½¨¶à¸ö£¬Êý¾Ý¿âµÄ»Ö¸´Ö±½Ó»Ö¸´µ½ÊµÀýϾͿÉÒÔÁË£¬Ïච......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ