oracle ÖеÄINTERVAL º¯ÊýÏê½â
INTERVAL YEAR TO MONTHÊý¾ÝÀàÐÍ
OracleÓï·¨:
INTERVAL 'integer [- integer]' {YEAR | MONTH} [(precision)][TO {YEAR | MONTH}]
¸ÃÊý¾ÝÀàÐͳ£ÓÃÀ´±íʾһ¶Îʱ¼ä²î, ×¢Òâʱ¼ä²îÖ»¾«È·µ½ÄêºÍÔÂ. precisionΪÄê»òÔµľ«È·Óò, ÓÐЧ·¶Î§ÊÇ0µ½9, ĬÈÏֵΪ2.
eg:
INTERVAL '123-2' YEAR(3) TO MONTH
±íʾ: 123Äê2¸öÔÂ, "YEAR(3)" ±íʾÄêµÄ¾«¶ÈΪ3, ¿É¼û"123"¸ÕºÃΪ3ΪÓÐЧÊýÖµ, Èç¹û¸Ã´¦YEAR(n), n<3¾Í»á³ö´í, ×¢ÒâĬÈÏÊÇ2.
INTERVAL '123' YEAR(3)
±íʾ: 123Äê0¸öÔÂ
INTERVAL '300' MONTH(3)
±íʾ: 300¸öÔÂ, ×¢Òâ¸Ã´¦MONTHµÄ¾«¶ÈÊÇ3°¡.
INTERVAL '4' YEAR
±íʾ: 4Äê, ͬ INTERVAL '4-0' YEAR TO MONTH ÊÇÒ»ÑùµÄ
INTERVAL '50' MONTH
±íʾ: 50¸öÔÂ, ͬ INTERVAL '4-2' YEAR TO MONTH ÊÇÒ»Ñù
INTERVAL '123' YEAR
±íʾ: ¸Ã´¦±íʾÓдíÎó, 123¾«¶ÈÊÇ3ÁË, µ«ÏµÍ³Ä¬ÈÏÊÇ2, ËùÒԸô¦Ó¦¸Ãд³É INTERVAL '123' YEAR(3) »ò"3"¸Ä³É´óÓÚ3СÓÚµÈÓÚ9µÄÊýÖµ¶¼¿ÉÒÔµÄ
INTERVAL '5-3' YEAR TO MONTH + INTERVAL '20' MONTH =
INTERVAL '6-11' YEAR TO MONTH
±íʾ: 5Äê3¸öÔ + 20¸öÔ = 6Äê11¸öÔÂ
Óë¸ÃÀàÐÍÏà¹ØµÄº¯Êý:
NUMTODSINTERVAL(n, 'interval_unit')
½«nת»»³Éinterval_unitËùÖ¸¶¨µÄÖµ, interval_unit¿ÉÒÔΪ: DAY, HOUR, MINUTE, SECOND
×¢Òâ¸Ãº¯Êý²»¿ÉÒÔת»»³ÉYEARºÍMONTHµÄ.
NUMTOYMINTERVAL(n, 'interval_unit')
interval_unit¿ÉÒÔΪ: YEAR, MONTH
eg: (Oracle Version 9204, RedHat Linux 9.0)
SQL> select numtodsinterval(100,'DAY') from dual;
NUMTODSINTERVAL(100,'DAY')
---------------------------------------------------------------------------
+000000100 00:00:00.000000000 &nb
Ïà¹ØÎĵµ£º
ѪҺÃ÷ϸ±íÈçÏ£º
create table "blood"."OC_CarryOrderD" (
ID nvarchar2(20) &n ......
oracle´´½¨±í¿Õ¼ä£¬´´½¨Óû§(ת)
¹Ø¼ü×Ö: oracle ±í¿Õ¼ä Óû§
//´´½¨ÁÙʱ±í¿Õ¼ä
create temporary tablespace test_temp
tempfile 'E:\oracle\product\10.2.0\oradata\testserver\test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//´´½¨Êý¾Ý±í¿Õ¼ä
create ta ......
oracleËøµÄÅŶӻúÖÆ£º
ÇëÇóËø¶¨ÐèÒªÅŶӡ£Èç¹ûij¸ö»á»°ÇëÇóÒ»¸öËø¶¨£¬µ«ÊÇÓÉÓÚÆäËû»á»°ÒѾËø¶¨ÁËÖ¸¶¨¼Ç¼»ò¶ÔÏó¶øÎÞ·¨»ñµÃËùÐèµÄËø¶¨£¬ÄÇôÕâ¸ö»á»°½«»áµÈ´ý¡£´Ëʱ£¬¿ÉÄܶà¸ö»á»°¶¼Ôڵȴý·ÃÎÊÏàͬ¼Ç¼»ò¶ÔÏó£¬ÔÚÕâÖÖÇé¿öÏ£¬ORACLE»á¸ú×ÙÕâЩ»á»°ÇëÇóËø¶¨µÄ˳Ðò¡£
Èç¹û ......
²é¿´µ±Ç°Êý¾Ý¿â¹éµµÈÕÖ¾²Ù×÷ģʽ:
select name,log_mode from v$database;
²é¿´¹éµµÈÕ־λÖÃ:
show parameter log_archive_dest; µÚÒ»¸ö¹éµµÎ»ÖÃ
show parameter log_archive_duplex_dest; µÚ¶þ¸ö¹éµµÎ»ÖÃ
ÏȹرÕÊý¾Ý¿â,È»ºó×°ÔØÊý¾Ý¿â:
shutdown immediate;
startup mount;
Ð޸Ĺ鵵ÈÕÖ¾²Ù×÷ģʽ,È»ºó´ò¿ªÊý¾Ý¿â ......
ÉÏһƪÎÄÕÂдÁËÒ»¸öoracleµÄÒ»¸öÐÐתÁеÄÀý×Ó£¬ÀïÃæÓõ½ÁËoracleÖÐÖØÒªµÄº¯Êý decode,ÕâƪÎÄÕ¾ÍÀ´¼òµ¥µÄѧϰÕâ¸öº¯Êý
DECODEº¯ÊýºÍÎÒÃÇÓïÑԽṹÖеÄÌõ¼þÓï¾ä£¨IF£©ÏàËÆ¡£Ëü½«ÊäÈëÊýÖµÓ뺯ÊýÖеIJÎÊýÁбíÏà±È½Ï£¬¸ù¾ÝÊäÈëÖµ·µ»ØÒ»¸ö¶ÔÓ¦Öµ¡£
DECODEº¯ÊýÏ൱ÓÚÒ»Ìõ¼þÓï¾ä(IF).Ëü½«ÊäÈëÊýÖµÓ뺯ÊýÖеIJÎÊýÁбíÏà±È½Ï£¬¸ù¾ÝÊ ......