sqlÄÚÖú¯Êý
Ò»°ãµØ£¬ÈÕÆÚ¸ñʽ˵Ã÷·ûÊDz»Ì«Ãô¸ÐµÄ¡£È»¶ø£¬µ±ÎªÁËÏÔʾ¶ø˵Ã÷ÈÕÆÚ¸ñʽ¡¢¶ÔÓÚÎı¾Êý¾ÝÖеÄ˵Ã÷·ûµÈÇé¿öÏ£¬Ëü¾Í±äµÃ±È½ÏÎñʵ¡¢¾ßÌåÁË¡£ÒÔÔ·ݵÄÃû×ÖΪÀý£¬Í¨¹ýÏÂÃæÒýÓõĽá¹û½âÊÍһϸÃÇé¿öµÄЧ¹û£º
TO_CHAR(SYSDATE,’MONTH’)=NOVEMBER
TO_CHAR(SYSDATE,’Month’)=November
TO_CHAR(SYSDATE,’month’)=november
µ±Äã¼üÈëµÄµ¥´ÊMONTH£¨Ô·ݣ©ÊÇ´óд×Öĸʱ£¬Ô·ÝÃû×ֵĽá¹û¾ÍÈ«²¿ËµÃ÷Ϊ´óд¡£·ñÔò£¬Èç¹û´®ËµÃ÷ʱµÄÊ××ÖĸÊÇ´óд£¬Ôò·µ»ØµÄÔ·ÝÃûÊ××ÖĸҲÊÇ´óд×Öĸ¡£Í¬ÑùµÄ¹æÔòÒ²ÊÊÓÃÓÚÏÂÃæµÄ¸ñʽ˵Ã÷·û£ºAD¡¢AM¡¢PM¡¢BC¡¢DAY¡¢DY¡¢MON¡¢RMºÍYEAR
SQLÄÚÖú¯Êý
ABS
ABSº¯Êý·µ»ØÒ»ÊýÖµµÄ¾ø¶ÔÖµ¡£¸ºÊý½«ÉáÈ¥Æ为ºÅ¡£ÏÂÃæÊÇËüµÄÓï·¨¸ñʽ£º
ABS(number)
ÆäÖУ¬numberÊÇÏ£ÍûµÃµ½Æä¾ø¶ÔÖµµÄÊýÖµ
ABSº¯Êý½ØÈ¥ÊýÖµµÄ·ûºÅ¡£ÈçÏÂÀýËùʾ£º
ABS(5)=5
ABS(5)=5
²»¹ÜÊÇ5»¹ÊÇ-5£¬Æä¾ø¶ÔÖµ¾ùΪ5¡£
SQLÄÚÖú¯Êý
ACOS
ACOSº¯Êý·µ»ØÒ»ÊýÖµµÄ·´ÓàÏÒÖµ¡£½á¹ûÒÔ»¡¶È±íʾ£¬ÇÒÔÚ0µ½PIÖ®¼ä¡£
ÆäÓï·¨¸ñʽÈçÏ£º
ACOS(number)
ÆäÖУ¬number±ØÐëÊÇ-1Óë1Ö®¼äµÄÖµ
ÏÂÃæµÄÀý×ÓÏÔʾÁË1ºÍ-1 µÄ·´ÓàÏÒÖµ£º
ACOS(1)=0
ACOS(-1)=3.1415927(PI)
SQLÄÚÖú¯Êý
ADD_MONTHS
ADD_MONTHSº¯Êý½«Ò»¸öÈÕÆÚÉϼÓÉÏÒ»Ö¸¶¨µÄÔ·ÝÊý£¬ËùÒÔ£¬ÈÕÆÚÖеÄÈÕ½«ÊDz»±äµÄ¡£È»¶ø£¬Èç¹û¿ªÊ¼ÈÕÆÚÊÇijÔµÄ×îºóÒ»Ì죬ÄÇô£¬½á¹û½«»áµ÷ÕûÒÔʹ·µ»ØÖµÈÔ¶ÔӦеÄÒ»ÔµÄ×îºóÒ»Ìì¡£Èç¹û£¬½á¹ûÔ·ݵÄÌìÊý±È¿ªÊ¼Ô·ݵÄÌìÊýÉÙ£¬ÄÇô£¬Ò²»áÏò»Øµ÷ÕûÒÔÊÊÓ¦ÓÐЧÈÕÆÚ¡£ÆäÓï·¨¸ñʽÈçÏ£º
ADD_MONTHS(date,months)
ÆäÖУº
date Ò»¸öÈÕÆÚÊýÖµ
months Òª¼ÓÉϵÄÔ·ÝÊý¡£Òª¼õÈ¥µÄÔ·ÝÊýÓøºÊý
ÏÂÃæµÄÀý×Ó½âÊÍÁ˸ú¯ÊýµÄʹÓãº
ADD_MONTHS(TO_DATE(’15-Nov-1961’,’d-mon-yyyy’),1) =’15-Dec-1961
ADD_MONTHS(TO_DATE(’30-Nov-1961’,’d-mon-yyyy’),1) =’31-Dec-1961
ADD_MONTHS(TO_DATE(’31-Jan-1999’,’d-mon-yyyy’),1) =’28-Feb-1999
×¢Ò⣬ÔÚÉÏÃæµÄµÚÈý¸öÀý×ÓÖУ¬º¯Êý½«²»µÃ²»½«31ÈÕÍù»Øµ÷ÕûΪ28ÈÕ£¬ÒÑʹ½á¹û¶ÔÓ¦ÐÂÒ»ÔµÄ×îºóÒ»Ìì¡£ÒòΪ£¬1999ÄêµÄ2Ô·ÝÖ»ÓÐ28Ìì¡£ÔÚµÚ¶þ¸öÀý×ÓÖУ¬ÔòÊÇ´Ó30Íùºóµ÷ÕûΪ31£¬Ò²Í¬ÑùÊÇΪÁ˱£³Ö¶ÔÓ¦µÄ×îºóÒ»Ìì¡£
SQLÄÚÖú¯Êý
ASCII
ASCIIº¯Êý·µ»ØÄãÖ¸ÏòµÄ×Ö·û´®Ê××ÖĸµÄÊ®½øÖƱíʾ´ú±íÂëÖµ¡£¸Ã·µ»ØÖµ»òÐíÊÇASCIIÂëÖµ£¬Ò²»òÐí²»ÊÇ¡£Èç¹ûÓû§µÄÊý¾
Ïà¹ØÎĵµ£º
ÒòΪ²»Ö§³Ö´æ´¢¹ý³Ì£¬ËùÒÔ²éѯÓï¾äÈçÏ£º
string SLQuery =
"INSERT INTO ParkLocation(ParkName,Latitude, Longtitude,Charge,TotalSpace,EmptySpace,ParkCaption,UpdataTime)"+
&nb ......
´íÎó1069ÊÇÒ»¸öWindows NT/2000µÄϵͳ´íÎó¡£´íÎó1069±íÃ÷·þÎñ²»Äܱ»Æô¶¯£¨µ±Æô¶¯·þÎñʱ·µ»Ø“µÇ¼ʧ°Ü”´íÎ󣩡£ÀýÈ磬µ±Æô¶¯MSSQLServer·þÎñʱ£¬µÃµ½ÈçÏ´íÎóÌáʾ£º
·¢Éú´íÎó1069£ºÓÉÓڵǼʧ°Ü¶øÎÞ·¨Æô¶¯·þÎñ
´ËʱÕýÔÚMSSQLServer·þÎñÉÏÖ´Ðи÷þÎñ²Ù×÷
Èç¹û·þÎñ±»Ò»¸öûÓГµÇ¼·þÎñ”ȨÏÞµÄÕÊ» ......
SQL INNER JOIN ¹Ø¼ü×Ö
SQL INNER JOIN ¹Ø¼ü×Ö
ÔÚ±íÖдæÔÚÖÁÉÙÒ»¸öÆ¥Åäʱ£¬INNER JOIN ¹Ø¼ü×Ö·µ»ØÐС£
INNER JOIN ¹Ø¼ü×ÖÓï·¨
SELECT column_name(s)
from table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
×¢ÊÍ£ºINNER JOIN Óë JOIN ÊÇÏàͬµÄ¡£
ÔʼµÄ±í (ÓÃÔÚÀ ......
SQL LEFT JOIN ¹Ø¼ü×Ö
SQL LEFT JOIN ¹Ø¼ü×Ö
LEFT JOIN ¹Ø¼ü×Ö»á´Ó×ó±í (table_name1) ÄÇÀï·µ»ØËùÓеÄÐУ¬¼´Ê¹ÔÚÓÒ±í (table_name2) ÖÐûÓÐÆ¥ÅäµÄÐС£
LEFT JOIN ¹Ø¼ü×ÖÓï·¨
SELECT column_name(s)
from table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
×¢ÊÍ£ºÔÚÄ ......
´æ´¢¹ý³Ì
Óŵ㣺
1.ÓÉÓÚÓ¦ÓóÌÐòËæ×Åʱ¼äÍÆÒƻ᲻¶Ï¸ü¸Ä£¬Ôöɾ¹¦ÄÜ£¬T£SQL¹ý³Ì´úÂë»á±äµÃ¸ü¸´ÔÓ£¬StoredProcedureΪ·â×°´Ë´úÂëÌṩÁËÒ»¸öÌ滻λÖá£
2.Ö´Ðмƻ®£¨´æ´¢¹ý³ÌÔÚÊ×´ÎÔËÐÐʱ½«±»±àÒ룬Õ⽫²úÉúÒ»¸öÖ´Ðмƻ®££ ʵ¼ÊÉÏÊÇ Microsoft SQL ServerΪÔÚ´æ´¢¹ý³ÌÖлñÈ¡ÓÉ T-SQL Ö¸¶¨µÄ½á¹û¶ø±ØÐë²ÉÈ¡µÄ²½ÖèµÄ¼Ç¼ ......