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

oracle ʱ¼ä ´¦Àí ´óÈ«

sysdate+(5/24/60/60) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£ºselect last_day(add_months(sysdate, -1)) from dual;
±¾ÔµÄ×îºóÒ»Ã룺select trunc(add_months(sysdate,1),'MM') - 1/24/60/60 from dual
±¾ÖÜÐÇÆÚÒ»µÄÈÕÆÚ£ºselect trunc(sysdate,'day')+1 from dual
Äê³õÖÁ½ñµÄÌìÊý£ºselect ceil(sysdate - trunc(sysdate, 'year')) from dual;
½ñÌìÊǽñÄêµÄµÚ¼¸ÖÜ :select to_char(sysdate,'fmww') from dual
½ñÌìÊDZ¾Ôµĵڼ¸ÖÜ:SELECT TO_CHAR(SYSDATE,'WW') - TO_CHAR(TRUNC(SYSDATE,'MM'),'WW') + 1 AS "weekOfMon" from dual
±¾ÔµÄÌìÊý
SELECT to_char(last_day(SYSDATE),'dd') days from dual
½ñÄêµÄÌìÊý
select add_months(trunc(sysdate,'year'), 12) - trunc(sysdate,'year') from dual
ϸöÐÇÆÚÒ»µÄÈÕÆÚ
SELECT Next_day(SYSDATE,'monday') from dual
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
--¼ÆË㹤×÷ÈÕ·½·¨
create table t(s date,e date);
alter session set nls_date_format = 'yyyy-mm-dd';
insert into t values('2003-03-01','2003-03-03');
insert into t values('2003-03-02','2003-03-03');
insert into t values('2003-03-07','2003-03-08');
insert into t values('2003-03-07','2003-03-09');
insert into t values('2003-03-05','2003-03-07');
insert into t values('2003-02-01','2003-03-31');
-- ÕâÀï¼Ù¶¨ÈÕÆÚ¶¼ÊDz»´øʱ¼äµÄ£¬·ñÔòÔÚËùÓÐÈÕÆÚÇ°¼Ótrunc¼´¿É¡£
select s,e,e-s+1 total_days,
trunc((e-s+1)/7)*5 + length(replace(substr('01111100111110',to_char(s,'d'),mod(e-s+1,7)),'0','')) work_days
from t;
-- drop table t;
Òý´Ë£ºhttp://www.itpub.net/showthread.php?s=1635506cd5f48b1bc3adbe4cde96f227&threadid=104060&perpage=15&pagenumber=1
================================================================================
Åжϵ±Ç°Ê±¼äÊÇÉÏÎçÏÂÎ绹ÊÇÍíÉÏ
SELECT CASE
WHEN to_number(to_char(SYSDATE,'hh24')) BETWEEN 6 AND 11 THEN 'ÉÏÎç'
WHEN to_


Ïà¹ØÎĵµ£º

oracle ±í¿Õ¼ä²Ù×÷

oracle±í¿Õ¼ä²Ù×÷Ïê½â
  1
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

oracleÊý¾Ý¿â±í½á¹¹µ¼³ö

½ñÌìÓÐͬÊ´òµç»°ÒªÇóÒª°Ñoracle¿âÀïµÄÒ»ÕűíµÄ¶¨Òåµ¼³ö¸ösqlÎļþ£¬µ±Ê±µÄµÚÒ»·´Ó¦¾ÍÊÇÒª½ÌËûÓÃexp/impÀ´»ñµÃ±í½á¹¹¶¨ÒåÎļþ£¬Ôڵ绰ÀïÃæ˵ÁË°ëÌ컹ÊÇûÄ̻ܽáËû£¬Ö»ºÃÅÜÁËÒ»ÌË»ú·¿¡£Â·ÉϾÍÔÚÏ룬oracleÕæÊÇÌÖÑᣬΪʲô²»ÔÚÆóÒµ¹ÜÀíÆ÷ÀïÖ±½Ó¼ÓÉϸö±í½á¹¹µ¼³öµÄÑ¡Ï»¹Òªº¦ÎÒÕâôÅÜÒ»ÌË£¬ÕæÊÇ@@#!!@!#@@@@
ÎÊÁËÏÂÒªµ¼³öÄÄ ......

ORACLEÒƶ¯Êý¾ÝÎļþµÄ·½·¨

ÒÔÇ°·¢¹ýһƪÒƶ¯Êý¾ÝÎļþµÄ·½·¨µÄÎÄÕ£¬²Î¼û
http://blog.csdn.net/wh62592855/archive/2009/11/20/4843764.aspx
²»¹ýµ±Ê±Ö»¸ø³öÁËÒ»¸öʾÀý¶øÒÑ£¬½ñÌìÔÚÊéÖп´µ½ÁËÁíÒ»ÖÖ·½·¨£¬×ܽáһϣ¬¼ÇÔÚÕâÀï¡£
OracleÌṩÁËÁ½ÌõÒƶ¯Êý¾ÝÎļþµÄÓï¾ä
1
ALTER TABLESPACE ±í¿Õ¼äÃû
RENAME DATAFILE 'ÎļþÃû' [,'ÎļþÃû']...
TO ' ......

ORACLE´æ´¢×Ó¾äµÄÓÅÏȼ¶

½ñÌìÔÚÊéÉÏ¿´µ½ÓÐÒ»¸öС½Ú½²´æ´¢×Ó¾äÓÅÏȼ¶µÄ£¬ËµÊµ»°£¬Æ½Ê±ÔÚ´´½¨¶ÔÏóµÄʱºò¼¸ºõ²»Ôõôָ¶¨´æ´¢×Ó¾äµÄ£¬Ò»°ã²ÉÓÃĬÈÏ¡£ºÇºÇ£¬¿ÉÄÜÊÇÒòΪ±È½ÏÀÁ°É£¬½ñÌì¼ÈÈ»¿´µ½ÁË£¬¾Í¼ÇÏÂÀ´£¬ÏàÐÅÒÔºó»áÓõõ½µÄ¡£
ORACLEÊý¾Ý¿âĬÈϵĴ洢²ÎÊý < ±í¿Õ¼äËù¶¨ÒåµÄ´æ´¢²ÎÊý < ¶ÎËù¶¨ÒåµÄ´æ´¢²ÎÊý
´æ´¢×Ó¾ä¿ÉÒÔÔÚ¶ÎÒ»¼¶ËµÃ÷ÒÔ¿ØÖÆÇø¶Î ......

oracle ³£Óú¯Êý

SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii(’A’) A,ascii(’a’) a,ascii(’0’) zero,ascii(’ ’) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2.CHR
¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ