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

¸ã¶¨MySQLÊý¾Ý¿âÖÐÎÄÄ£ºý¼ìË÷ÎÊÌâ

ÔÚ MySQLÏ£¬ÔÚ½øÐÐÖÐÎÄÄ£ºý¼ìË÷ʱ£¬¾­³£»á·µ»ØһЩÓëÖ®²»Ïà¹ØµÄ¼Ç¼£¬Èç²éÕÒ "%a%" ʱ£¬·µ»ØµÄ¿ÉÄÜÓÐÖÐÎÄ×Ö·û£¬È´Ã»ÓÐa×Ö·û´æÔÚ¡£±¾ÈËÒÔÇ°Ò²ÔøÓöµ½¹ýÀàËÆÎÊÌ⣬¾­ÏêϸÔĶÁMySQLµÄManual£¬·¢ÏÖ¿ÉÒÔÓÐÒ»ÖÖ·½·¨ºÜ·½±ãµÄ½â¾ö²¢µÃµ½ÂúÒâµÄ½á¹û¡£
¡¡¡¡Àý×Ó£º
¡¡¡¡Ï£Íûͨ¹ý“±êÌ┶ÔÐÂÎÅ¿â½øÐмìË÷£¬¹Ø¼ü×Ö¿ÉÄÜ°üº¬ÊÇÖÐÓ¢ÎÄ£¬ÈçÏÂSQLÓï¾ä£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where title like '%a%'
¡¡¡¡·µ»ØµÄ½á¹û£¬Ä³Ð©title×Ö¶ÎÈ·¶¨´øÁË“a”¹Ø¼ü×Ö£¬¶øÓÐЩÔòÖ»ÓÐÖÐÎÄ£¬µ«Ò²ËæÖ®·µ»ØÔÚ¼ìË÷½á¹ûÖС£
¡¡¡¡½â¾ö·½·¨£¬Ê¹Óà BINARY ÊôÐÔ½øÐмìË÷£¬È磺
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where binary title like '%a%'
¡¡¡¡·µ»ØµÄ½á¹û½Ï֮ǰÕýÈ·£¬µ«Ó¢ÎÄ×ÖĸÇø·Ö´óСд£¬¹ÊÓÐʱÔÚ¼ìË÷Èç“Achech”¼°“achech”µÄ½á¹ûÊDz»Ò»ÑùµÄ¡£ÖªµÀÁËʹÓà BINARY ÊôÐÔ¿ÉÒÔ½â¾öÇ°ÃæÕâ¸öÎÊÌ⣬ÔÙ¿´¿´ MySQL Ö§³ÖµÄUCASE ¼° CONCAT º¯Êý£¬ÆäÖÐ UCASE Êǽ«Ó¢ÎÄÈ«²¿×ª³É´óд£¬¶øCONCATº¯ÊýµÄ×÷ÓÃÊǶÔ×Ö·û½øÐÐÁ¬½Ó£¬ÒÔÏÂÊÇÎÒÃÇÍêÈ«½â¾öºóµÄSQL Óï¾ä£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news
¡¡¡¡where binary ucase(title) like concat('%',ucase('a'),'%')
¡¡¡¡¼ìË÷µÄ²½ÖèÊÇÏȽ«ÊôÐÔÖ¸¶¨Îª BINARY £¬ÒÔ¾«È·¼ìË÷½á¹û£¬¶ø±» like µÄ titleÄÚÈÝ´æÔÚ´óСд×ÖĸµÄ¿ÉÄÜ£¬¹ÊÏÈʹÓà ucase º¯Êý½«×Ö¶ÎÄÚÈÝÈ«²¿×ª»»³É´óд×Öĸ£¬È»ºóÔÙ½øÐÐ like ²Ù×÷£¬¶ø like µÄ²Ù×÷ʹÓÃÄ£ºý·½·¨£¬Ê¹Óà concatµÄºÃ´¦ÊÇ´«½øÀ´µÄ¿ÉÒÔÊÇÖ±½ÓµÄ¹Ø¼ü×Ö£¬²»ÐèÒª´ø“%”ÍòÓ÷û£¬½«“'a'”Ö±½Ó»»³ÉÄãµÄ±äÁ¿£¬ÔÚÈκÎÓïÑÔ϶¼ÍòÊÂÎÞÓÇÁË¡£ µ±È»ÄãÒ²¿ÉÒÔÕâôд£º
¡¡¡¡QUOTE:
¡¡¡¡select id,title,name from achech_com.news where binary ucase(title) like ucase('%a%')
¡¡¡¡¼ìË÷µÄ½á¹û»¹ËãÂúÒâ°É£¬²»¹ýËٶȿÉÄÜ»áÒò´Ë¶øÂýNºÁÃë¡£


Ïà¹ØÎĵµ£º

mysql²éѯһÌ죬²éѯһÖÜ£¬²éѯһ¸öÔµÄÊý¾Ý

²éѯһÌ죺
select * from table where to_days(column_time) = to_days(now());
select * from table where date(column_time) = curdate();
²éѯһÖÜ£º
select * from table   where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);
²éѯһ¸öÔ£º
select * from table where DATE_SUB(CUR ......

mysql ÃüÁî

1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°È ......

mysql Ô´Âë±àÒë°²×°

»·¾³ rhel5.4
×°ºÃgcc ºÍÏàÓ¦µÄ¿â¡£ÎÒÕâ±ßÓöµ½curses¡£DebianϵͳµÄ»°Ðè°²×°apt-get install libncurses5-dev¡£
ÏÂÔØmysqlÔ´Âë°ü£¬ÎÒ×Ô¼ºÔÚmyslq¹Ù·½ÍøÕ¾ÉÏÏÂÁËÒ»¸ö“mysql-5.0.87.tar.gz”
cd /usr/local/src/
½â°ü tar zxvf mysql-5.0.87.tar.gz
cd mysql-5.0.87
./configure --prefix=/usr/local/servic ......

¡¾×ª¡¿MySQLÖÐSQLÓÅ»¯ºÍ¼Ü¹¹Éè¼ÆµÄһЩ¼òµ¥Ïë·¨

ÆÕͨMySQLÔËÐУ¬Êý¾ÝÁ¿ºÍ·ÃÎÊÁ¿²»´óµÄ»°£¬ÊÇ×ã¹»¿ìµÄ£¬µ«Êǵ±Êý¾ÝÁ¿ºÍ·ÃÎÊÁ¿¾çÔöµÄʱºò£¬ÄÇô¾Í»áÃ÷ÏÔ·¢ÏÖMySQLºÜÂý£¬ÉõÖÁdownµô£¬ÄÇô¾ÍÒª¿¼ÂÇÓÅ»¯ÎÒÃǵÄMySQLÁË¡£
ÓÅ»¯ÎÞ·ÇÊÇ´ÓÈý¸ö½Ç¶ÈÈëÊÖ£º
µÚÒ»¸öÊÇ´ÓÓ²¼þ£¬Ôö¼ÓÓ²¼þ£¬Ôö¼Ó·þÎñÆ÷
µÚ¶þ¸ö¾ÍÊǶÔÎÒÃǵÄMySQL·þÎñÆ÷½øÐÐÓÅ»¯£¬Ôö¼Ó»º´æ´óС£¬¿ª¶à¶Ë¿Ú£¬¶Áд·Ö¿ª
µÚÈý¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ