OracleÈÕÆÚº¯Êý next_day
ÔÚOracleÊÇÌṩÁËnext_dayÇóÖ¸¶¨ÈÕÆÚµÄÏÂÒ»¸öÈÕÆÚ.
Óï·¨ : next_day( date, weekday )
date is used to find the next weekday.
weekday is a day of the week (ie: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY)
¿ÉÓÃÓÚ:
Oracle 9i, Oracle 10g, Oracle 11g
For example:
next_day('01-Aug-03', 'TUESDAY') would return '05-Aug-03'
next_day('06-Aug-03', 'WEDNESDAY') would return '13-Aug-03'
next_day('06-Aug-03', 'SUNDAY') would return '10-Aug-03'
µ«ÊÇÔÚÖ´ÐÐÈçÏÂÃüÁîʱ³ö´í,´íÎóÌáʾΪ²»ºÏ·¨µÄ month,µ«Êµ¼ÊÉϵ¥´Ê±¾Éí²¢Ã»Óдí,¶øÊÇ»·¾³ÎÊÌâ:
SQL> select next_day('01-Aug-03', 'TUESDAY') from dual;
select next_day('01-Aug-03', 'TUESDAY') from dual
*
ERROR at line 1:
ORA-01843: not a valid month
·ÖÎöÎÊÌâ:
Ê×ÏȲéѯµ±Ç°ÈÕÆÚÓïÑÔ NLS_DATE_LANGUAGE Öµ.
SQL>select * from v$nls_parameters;
PARAMETER VALUE
---------------------------------------------------------------- -----------------------------------
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY  
Ïà¹ØÎĵµ£º
½ñÌì×öͳ¼ÆµÄʱºò·¢ÏÖÒ»¸öÊý¾Ý±íÃæÉÏ¿´À´ÊÇ‘920 ’µ«È¥¿Õ¸ñÎÞÂÒÈçºÎ¶¼È¥²»µô£¬×îºó·¢ÏÖÊDz»¿É¼û×Ö·û¡£¡£¡£
ÓÚÊÇÔÚÍøÉÏËѵ½Ò»ÆªÎÄÕ£¬ÈçºÎÀ´ÅжÏÕâ¸ö²»¿É¼û×Ö·ûµÄÎÊÌâ~
°´ÏÂÃæµÄ·½·¨Åжϳö²»¿É¼û×Ö·ûµÄascIIÂëÊÇ10£¬ÓÚÊÇÓÃrtrim('Ô×Ö·û','chr(10)')À´È¥µôÕâ¸ö²»¿É¼û×Ö·û¡£
½ñÌìÓöµ½Ò»Ôò°¸Àý£¬ÎÊÌâÊÇÊý¾Ý¿âÖп ......
Oracle×Ö·û´®´¦Àíº¯Êý
2008Äê10ÔÂ18ÈÕ ÐÇÆÚÁù 23:45
ÏîÄ¿ÖÐÓÐÉæ¼°´æ´¢¹ý³Ì¶Ô×Ö·û´®µÄ´¦Àí£¬ËùÒԾͽ«ÔÚÍøÉϲéÕÒµ½µÄ×ÊÁÏ»ã×Ü£¬×öÒ»¸öÐÅϢƴ½ÓʽµÄ×ܽᡣ
ÒÔÏÂÐÅÏ¢¾ùÀ´×Ô»¥ÁªÍø£¬Ìù³öÀ´Ò»Ôò×Ô¼º±£´æÒÔ´ýÒÔºóʹÓã¬Ò»Ôò¹©´ó¼Ò·ÖÏí¡£
×Ö·ûº¯Êý——·µ»Ø×Ö·ûÖµ
ÕâЩº¯ÊýÈ«¶¼½ÓÊÕµÄÊÇ×Ö·û×åÀàÐ͵IJÎÊý(CHR³ýÍâ)²¢ ......
Ê×ÏȲéÕÒÄ¿±êÓû§µÄµ±Ç°½ø³Ì£º
select sid,serial# from v$session where username='ERP';
²éѯ½á¹û£º
sid serial#
222 123
122 233
Ç¿ÐжϿªÓû§Á¬½Ó£º
alter system kill session 'sid,serial';
ÀýÈ磺
alter system kill session '222,123';
......
ºÜ¶àÈ˶¼Åöµ½¹ýÒòΪ×Ö·û¼¯²»Í¬¶øʹÊý¾Ýµ¼Èëʧ°ÜµÄÇé¿ö¡£ÕâÉæ¼°Èý·½ÃæµÄ×Ö·û¼¯£¬Ò»ÊÇoracel server¶ËµÄ×Ö·û¼¯£¬¶þÊÇoracle client¶ËµÄ×Ö·û¼¯;ÈýÊÇdmpÎļþµÄ×Ö·û¼¯¡£ÔÚ×öÊý¾Ýµ¼ÈëµÄʱºò£¬ÐèÒªÕâÈý¸ö×Ö·û¼¯¶¼Ò»Ö²ÅÄÜÕýÈ·µ¼Èë¡£
¡¡¡¡1¡¢²éѯoracle server¶ËµÄ×Ö·û¼¯
¡¡¡¡ÓкܶàÖÖ·½·¨¿ÉÒÔ²é³öor ......
decodeº¯Êý
Óï·¨£º
decode(expr,search,result[,search,result]..[,search,result][,default])
½âÊÍ£º
±È½ÏexprÓëÿ¸ösearchµÄÖµ£¬Èç¹ûexprµÈÓÚij¸ösearch£¬Ôò·µ»ØÏàÓ¦µÄresult£»Èç¹ûûÓÐÆ¥ÅäµÄÖµ£¬Ôò·µ»ØdefaultÖµ£»Èç¹ûûÓÐÖ¸¶¨defaultÖµ£¬Ôò·µ»Ønull
×¢Ò⣺
±È½ÏÇ°£¬Oracle×Ô¶¯½«exprµÄÊý¾ÝÀàÐÍת»»³ÉµÚÒ»¸ösear ......