MySQL³£Óú¯Êý
Ò»¡¢Êýѧº¯Êý
ABS(x) ·µ»ØxµÄ¾ø¶ÔÖµ
BIN(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØxµÄ¶þ½øÖÆ£¨OCT·µ»Ø°Ë½øÖÆ£¬HEX·µ»ØÊ®Áù½øÖÆ£©
CEILING(x) ·µ»Ø´óÓÚxµÄ×îСÕûÊýÖµ
EXP(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖµe£¨×ÔÈ»¶ÔÊýµÄµ×£©µÄx´Î·½
FLOOR(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØСÓÚxµÄ×î´óÕûÊýÖµ
GREATEST(x1,x2,...,xn)¡¡¡¡·µ»Ø¼¯ºÏÖÐ×î´óµÄÖµ
LEAST(x1,x2,...,xn) ·µ»Ø¼¯ºÏÖÐ×îСµÄÖµ
LN(x) ·µ»ØxµÄ×ÔÈ»¶ÔÊý
LOG(x,y)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØxµÄÒÔyΪµ×µÄ¶ÔÊý
MOD(x,y) ·µ»Øx/yµÄÄ££¨ÓàÊý£©
PI()¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØpiµÄÖµ£¨Ô²ÖÜÂÊ£©
RAND()¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»Ø£°µ½£±ÄÚµÄËæ»úÖµ,¿ÉÒÔͨ¹ýÌṩһ¸ö²ÎÊý(ÖÖ×Ó)ʹRAND()Ëæ»úÊýÉú³ÉÆ÷Éú³ÉÒ»¸öÖ¸¶¨µÄÖµ¡£
ROUND(x,y)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»Ø²ÎÊýxµÄËÄÉáÎåÈëµÄÓÐyλСÊýµÄÖµ
SIGN(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ·µ»Ø´ú±íÊý×ÖxµÄ·ûºÅµÄÖµ
SQRT(x)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ·µ»ØÒ»¸öÊýµÄƽ·½¸ù
TRUNCATE(x,y) ·µ»ØÊý×Öx½Ø¶ÌΪyλСÊýµÄ½á¹û
¶þ¡¢¾ÛºÏº¯Êý(³£ÓÃÓÚGROUP BY´Ó¾äµÄSELECT²éѯÖÐ)
AVG(col)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖ¸¶¨ÁеÄƽ¾ùÖµ
COUNT(col)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖ¸¶¨ÁÐÖзÇNULLÖµµÄ¸öÊý
MIN(col)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖ¸¶¨ÁеÄ×îСֵ
MAX(col)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖ¸¶¨ÁеÄ×î´óÖµ
SUM(col)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»ØÖ¸¶¨ÁеÄËùÓÐÖµÖ®ºÍ
GROUP_CONCAT(col)¡¡¡¡¡¡¡¡ ·µ»ØÓÉÊôÓÚÒ»×éµÄÁÐÖµÁ¬½Ó×éºÏ¶ø³ÉµÄ½á¹û
Èý¡¢×Ö·û´®º¯Êý
ASCII(char)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·µ»Ø×Ö·ûµÄASCIIÂëÖµ
BIT_LENGTH(str)¡¡¡¡¡¡¡¡¡¡¡¡·µ»Ø×Ö·û´®µÄ±ÈÌس¤¶È
CONCAT(s1,s2...,sn)¡¡¡¡¡¡¡¡½«s1,s2...,snÁ¬½Ó³É×Ö·û´®
CONCAT_WS(sep,s1,s2...,sn)¡¡¡¡½«s1,s2...,snÁ¬½Ó³É×Ö·û´®£¬²¢ÓÃsep×Ö·û¼ä¸ô
INSERT(str,x,y,instr) ¡¡¡¡ ½«×Ö·û´®str´ÓµÚxλÖÿªÊ¼£¬y¸ö×Ö·û³¤µÄ×Ó
Ïà¹ØÎĵµ£º
ÅäÖÃÖ÷´Ó£º
Á½Ì¨·þÎñÆ÷mysql°æ±¾Ò»Ñù£¬
Server version: 5.1.16-beta-log MySQL Community Server
ÅäÖûù±¾Ò»Ñù¡¢Æô¶¯²ÎÊýÒ»Ñù
Ö÷µÄ¿ÉÒÔ·ÃÎʴӵģ¬
µ«ÊÇ
´ÓÄDZßÔõôÁ¬½ÓÖ÷µÄ£¬¶¼ÊÇʧ°Ü£º
[root@2006 htmlfile]# mysql -h192.168.xx.xxx -uxxx -pxxx --default-character-set=GBK --reconnect
ERROR 2003 (HY000): C ......
×î½üÐÂÂòÁ˸öµçÄÔ£¬ÏµÍ³ÊÇwindows7£¬window7ÔÚ½çÃ棬¹¦ÄÜ·½Ã涼ͦÈÃÈËÂúÒâµÄ£¬¸Ð¾õºÜˬ£¬²»Ë¬µÄÊÇÓÖÒªÖØа²×°»·¾³ÁË¡£
ËùÓÐÈí¼þ¾ù°²×°ÔÚF:\server\ÏÂ
apacheĿ¼£ºF:\server\apache2.2
phpĿ¼£ºF:\server\php
msyqlĿ¼£ºF:\server\mysql
Ò»¡¢°²×°apache
°²×°apacheµÄ°æ±¾ÊÇ£ºhttpd-2.2.15-win32-x86-no_ssl.msi
° ......
×òÌìΪһ¸öÏîÄ¿×öÊý¾Ý¿â£¬ÏîÄ¿Éæ¼°µ½¶©µ¥£¬ÔÚÉè¼ÆÊý¾Ý¿â×ÖµäµÄʱºò ¾Í°ÑÕâ¸ö±íÃû¶¨ÎªÁËorder£¬½¨±íµÄʱºòÔõô½¨¶¼²»¶Ô£¬ÌáʾÊDZíÃû¸½½ü³öÏÖÎÊÌ⣬µ±Ê±¾õµÃ²»¿ÉÄÜ°¡ Ò²ÐíÊÇ×Ö¶ÎÀàÐÍÄĶù³öÁËÎÊÌ⣬²éÁ˺þã¬ÊÔÁ˺ü¸´Î£¬»¹ÊDz»ÐУ¬ºóÀ´Í»È»»ÐÈ»´óÎò£¬order byÊÇÅÅÐòÓï¾ä£¬order¿Ï¶¨ÊDZ£Áô×Ö£¬Ôõô¿ÉÄÜ×ö±íÃûÄØ¡£¡£¡£Á¢¼´°Ñ±í ......
mssql,oracleÖÐ
test񡜧
1 5 abc
2 6 bcd
1 7 ade
2 8 adc
select a,b,c
from(
select a,b,c
,row_number()over(partition by a order by b desc) rn
from test
) &nb ......
PHP³ÌÐòºÍMySqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУ ......