MYSQL °üº¬ÊÂÎï,²ÎÊý,ÓαêµÈµÄ×ÛºÏʹÓÃÀý×Ó,Ç°ÕÂ(1)
1.Ê×ÏȵöÔmysql ÀïÃæµÄ²ÎÊý½øÐнéÉÜÏÂ:
procedure--in:ÊäÈë²ÎÊý,outÊä³ö²ÎÊý,inoutÕâ¸ö¾Í²»ÓÃ˵ÁË,´ó¸ÅÒ²²Âµ½ÁË
declare:ÉùÃ÷±äÁ¿.¼ÇÖ÷,ËùÓÐÉùÃ÷±ØÐëÔÚ·ÇÉùÃ÷Óï¾äÇ°Íê³É,·ñÔò»á±¨´í
2.mysql ³£Óú¯Êý½éÉÜ:
*.concat('s','a',5) ¿ÉÒÔÄÇÊýֵת»»³É×Ö·û´®,Ò²¿ÉÒÔ½øÐÐ×Ö·û´®µÄºÏ²¢
Èç:set str=concat('asd','ad',56) ----> str='asdad56'
declare num in;set num=156;set @ste=concat('',num)|(num);-->@str='156'
mysql> select CONCAT('My', NULL, 'QL');
¡¡¡¡ -> NULL
*.ASCII(str),·µ»Ø×Ö·û´®strµÄµÚÒ»¸ö×Ö·ûµÄASCIIÖµ(strÊÇ¿Õ´®Ê±·µ»Ø0)
Èç:mysql> select ASCII('2');-> 50
*.CONV(N,from_base,to_base),¶ÔÊý×ÖN½øÖÆת»»,²¢×ª»»Îª×Ö´®·µ»Ø(ÈκβÎÊýΪNULLʱ·µ»ØNULL,½øÖÆ·¶Î§Îª2-36ÖÆ, µ±to_baseÊǸºÊýʱN×÷ΪÓзûºÅÊý·ñÔò×÷ÎÞ·ûºÅÊý,CONVÒÔ64λµã¾«¶È¹¤×÷)
Èç:mysql> select CONV("a",16,2);
¡¡¡¡ -> '1010'
mysql> select CONV(-17,10,-18);
¡¡¡¡ -> '-H'
mysql> select CONV(10+"10"+'1
Ïà¹ØÎĵµ£º
DELIMITER $$
DROP PROCEDURE IF EXISTS `hotel`.`prc_page_hotel_result`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `hotel`.`prc_page_hotel_result`(
in currpage int,
in columns varchar(500),
in tablename &n ......
À´×Ô£ºhttp://www.sofee.cn/blog/2007/07/18/91/
MySQL 5.1ÐÂÌØÐÔ֮ʼþµ÷¶ÈÆ÷(Event Scheduler)
CREATE-EVENT, cron, Event-Scheduler, ´¥·¢Æ÷, ¼Æ»®ÈÎÎñ, MySQL,Triggers, ʼþµ÷¶ÈÆ÷, ×÷Òµµ÷¶È
July 18, 2007 at 20:34:50 · Filed under MySQL
Ò»¡¢Ç°ÑÔ
×ÔMySQL5.1 ......
mysql(°üÀ¨ËùÓÐ5.*ϵÁÐ,5.1.21֮ǰ)µÄÂý²éѯÈÕ־ĬÈÏÊÇÒÔÃëΪµ¥Î»µÄ,¿ÉÒÔͨ¹ýset [session|global] long_query_time=1Õâ¸ö×îµÍÒ²¾ÍÊÇ¿ÉÒÔÉèÖõ½1Ãë,¶ÔÓÚ0.5,0.005Ö®Àà¾ÍÎÞÄÜΪÁ¦ÁË,Õâʱºò¿ÉÒÔÓÐmicroslow patch(msl patch)²¹¶¡À´Íê³ÉÕâÒ»¹¤×÷,Õâ¸ö¹¦Äܵĺô¦×ÔÈ»²»ÑÔ¶øÓ÷. ÔÚmysql5.1.21¼°ÒÔºó°æ±¾¿ÉÒÔͨ¹ýset [session|gl ......
Ò»¡¢²ÎÕÕÍêÕûÐÔ(Referential integrity)ºÍÍâ¼ü(foreign key)
²ÎÕÕÍêÕûÐÔ(Referential integrity)ÊÇÓÃÓÚÔ¼¶¨Á½¸ö¹Øϵ֮¼äµÄÁªÏµ£¬ÀíÂÛÉϹ涨£ºÈôMÊǹØϵSÖеÄÒ»ÊôÐÔ×飬ÇÒMÊÇÁíÒ»¹ØϵZµÄÖ÷¹Ø¼ü×Ö£¬Ôò³ÆMΪ¹ØϵS¶ÔÓ¦¹ØϵZµÄÍâ¹Ø¼ü×Ö¡£ÈôMÊǹØϵSµÄÍâ¹Ø¼ü×Ö£¬ÔòSÖÐÿһ¸öÔª×éÔÚMÉϵÄÖµ±ØÐëÊÇ¿ÕÖµ»òÊǶÔÓ¦¹ØϵZÖÐij¸öÔª×éµÄÖ÷¹ ......
2008Äê2Ô±»SunÒÔ10ÒÚÃÀÔªÊÕ¹ºµÄMySQL£¬Ç°Â·ÈÔÈ»ÄÑÁÏ¡£¶ÔÓÚ´ó¼ÒÀ´Ëµ£¬±È½ÏÓÐÒâ˼µÄÊÇ£¬10ÔÂ27ÈÕ£¬Red HatÐû²¼ÒÔ1900ÍòÃÀԪע×Ê¿ªÔ´Êý¾Ý¿â³§ÉÌ—EnterpriseDB¡£ÏûÏ¢Ò»³ö£¬Á¢¿Ì±»Òµ½ç½â¶ÁΪRed HatÁí±Ùõ辶·¢Õ¹¿ªÔ´Êý¾Ý¿â£¬²»ÏëÒÔºóÊÜÖÆÓÚOracleºÍMySQL¡£
Èç¹ûMySQLµÄ´óÆìµ¹ÏÂÁË£¬ÖÚ¶àÁ¦Á¿·ÖÉ¢ÇÒÈõСµÄ¿ªÔ´Êý¾Ý¿â½«Õ¹¿ª ......