pl/sql³£Óú¯Êý
1¡£Sysdate µ±Ç°ÈÕÆÚºÍʱ¼ä
SQL> Select sysdate from dual;
SYSDATE
----------
21-6ÔÂ -05
2¡£Last_day ±¾ÔÂ×îºóÒ»Ìì
SQL> Select last_day(sysdate) from dual;
LAST_DAY(S
----------
30-6ÔÂ -05
3¡£Add_months(d,n) µ±Ç°ÈÕÆÚdºóÍÆn¸öÔÂ
ÓÃÓÚ´ÓÒ»¸öÈÕÆÚÖµÔö¼Ó»ò¼õÉÙһЩÔ·Ý
date_value:=add_months(date_value,number_of_months)
SQL> Select add_months(sysdate,2) from dual;
ADD_MONTHS
----------
21-8ÔÂ -05
4¡£Months_between(f,s) ÈÕÆÚfºÍs¼äÏà²îÔÂÊý
SQL> select months_between(sysdate,to_date('2005-11-12','yyyy-mm-dd'))from dual;
MONTHS_BETWEEN(SYSDATE,TO_DATE('2005-11-12','YYYY-MM-DD'))
----------------------------------------------------------
-4.6966741
5¡£NEXT_DAY(d, day_of_week)
·µ»ØÓÉ"day_of_week"ÃüÃûµÄ£¬ÔÚ±äÁ¿"d"Ö¸¶¨µÄÈÕÆÚÖ®ºóµÄµÚÒ»¸ö¹¤×÷ÈÕµÄÈÕÆÚ¡£²ÎÊý"day_of_week"±ØÐëΪ¸ÃÐÇÆÚÖеÄijһÌì¡£
SQL> SELECT next_day(to_date('20050620','YYYYMMDD'),1) from dual;
NEXT_DAY(T
----------
26-6ÔÂ -05
6¡£current_date()·µ»Øµ±Ç°»á»°Ê±ÇøÖеĵ±Ç°ÈÕÆÚ
date_value:=current_date
SQL> column sessiontimezone for a15
SQL> select sessiontimezone,current_date from dual;
SESSIONTIMEZONE CURRENT_DA
--------------- ----------
+08:00 13-11ÔÂ-03
SQL> alter session set time_zone='-11:00' 2 /
»á»°ÒѸü¸Ä¡£
SQL> select sessiontimezone,current_timestamp from dual;
SESSIONTIMEZONE CURRENT_TIMESTAMP
--------------- ------------------------------------
-11:00 12-11ÔÂ-03 04.59.13.668000 ÏÂÎç -11:00
7¡£current_timestamp()ÒÔtimestamp with time zoneÊý¾ÝÀàÐÍ·µ»Øµ±Ç°»á»°Ê±ÇøÖеĵ±Ç°ÈÕÆÚ
SQL> select current_timestamp from dual;
CURRENT_TIMESTAMP
---------------------------------------------------------------------------
21-6ÔÂ -05 10.13.08.220589 ÉÏÎç +08:00
8¡£dbtimezone()·µ»ØʱÇø
SQL> select dbtimezone from dual;
DBTIME
------
-08:00
9¡£extract()ÕÒ³öÈÕÆÚ»ò¼ä¸ôÖµµÄ×Ö¶ÎÖµ
date_value:=extract(date_field from [datetime_value|interval_value])
SQL> select extract(month from sysdate) "This Month" from dual;
This Month
--------
Ïà¹ØÎĵµ£º
¶¨Ê±ÖØÆôSQL ServerºÍTomcat
[http://hi.baidu.com/personnel/blog/item/020d5edf020a281248540306.html]
¶¨Ê±ÖØÆôSQL ServerºÍTomcat
2007-06-07 08:23
ÒÔǰûÓÐ×Ô¼º¹ÜÀí·þÎñÆ÷»¹²»ÖªµÀ£¬SQL Server·þÎñÆ÷µÄÄÚ´æËæ×ÅÔËÐеÄʱ¼äÔö³¤¶ø²»¶ÏÔö³¤¡£
ÓÃÁËÒ»Á½ÌìÖ®ºó·¢ÏÖ½ø³ÌÖеÄSQL ServerÒѾռÓÃÁ˽ü1.3GµÄÄڴ棬ÄÚ´æÒ»¹ ......
ÓÐÀý±í£ºemp
emp_no name age
001 Tom 17
002 &nb ......
²é¿´SQL°æ±¾ÒÔ¼°²¹¶¡µÄ·½·¨ ¡¾http://hi.baidu.com/yangyanchen2008/blog/item/afe337173318130fc93d6df6.html¡¿
²é¿´SQL°æ±¾µÄ·½·¨£º´ò¿ª²éѯ·ÖÎöÆ÷£¬Ê¹ÓÓSELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') ”²éѯ¼´¿É¡£SQL°æ±¾¶ÔÕÕ±í£º
......
MS SQLµÄһЩ¾µä³£ÓòÙ×÷Óï¾ä»ã×Ü ¡¾http://hi.baidu.com/kychen88/blog/item/b3c8e7d960821b3c32fa1cee.html¡¿
1.°´ÐÕÊϱʻÅÅÐò:
Select * from TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
2.Êý¾Ý¿â¼ÓÃÜ:
select encrypt('ÔʼÃÜÂë')
select pwdencrypt('ÔʼÃÜÂë')
select pwdcomp ......