mysql µÄdelimiter
ÎÒÔÚ EMS SQL Manager 2005 for MySQL Õâ¸ö MySQL ͼÐοͻ§¶ËÏ¿ÉÒÔ˳ÀûÔËÐС£µ«ÊÇÔÚ SQLyog MySQL GUI v5.02 Õâ¸ö¿Í»§¶Ë¾Í»á³ö´í¡£×îºóÕÒµ½ÔÒòÊÇûÓÐÉèÖúà delimiter µÄÎÊÌ⡣ĬÈÏÇé¿öÏ£¬delimiter “;” ÓÃÓÚÏò MySQL Ìá½»²éѯÓï¾ä¡£ÔÚ´æ´¢¹ý³ÌÖÐÿ¸ö SQL Óï¾äµÄ½áβ¶¼Óиö “;”£¬Èç¹ûÕâʱºò£¬Ã¿·ê “;” ¾ÍÏò MySQL Ìá½»µÄ»°£¬µ±È»»á³öÎÊÌâÁË¡£ÓÚÊǸü¸Ä MySQL µÄ delimiter£¬ÉÏÃæ MySQL ´æ´¢¹ý³Ì¾Í±à³ÌÕâÑù×ÓÁË£º
mysql> delimiter // -- ¸Ä±ä MySQL delimiter Ϊ£º“//” ĩβ²»Òª·ûºÅ “;”
mysql>
mysql> drop procedure if exists pr_stat_agent //
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> -- call pr_stat_agent ('2008-07-17', '2008-07-18')
mysql>
mysql> create procedure pr_stat_agent
-> (
-> pi_date_from date
-> ,pi_date_to date
-> )
-> begin
-> -- check input
-> if (pi_date_from is null) then
-> set pi_date_from = current_date();
-> end if;
->
-> if (pi_date_to is null) then
-> set pi_date_to = pi_date_from;
-> end if;
->
-> set pi_date_to = date_add(pi_date_from, interval 1 day);
->
-> -- stat
-> select agent, count(*) as cnt
-> from apache_log
-> where request_time >= pi_date_from
-> &nb
Ïà¹ØÎĵµ£º
<!-- [if gte mso 10]>
ÒÔÏÂÄÚÈÝÀ´×ÔÍøÂ磬ÒѲâÊÔ¡£
½áÂÛ£º
mysql
ÐÐËø²»°²È«£¬ËæÊý¾ÝµÄ±ä»¯£¬¿ÉÄÜ»á³öÏÖÐÐËøÎÞЧ£¡Òò´Ë£¬·ÇÈ·¶¨Çé¿öÏ£¬²»Òª¶Ô
mysql
±í¼ÓÐÐËøÀ´¿ØÖÆÒµÎñÂß¼¡£
ÓÉÓÚÒµÎñÂß¼µÄÐèÒª£¬±ØÐë¶ÔÊý¾Ý±íµÄÒ»Ðлò¶àÐмÓÈëÐÐËø£¬¾Ù¸ö×î¼òµ¥µÄÀý×Ó£¬Í¼Êé½èÔÄϵͳ¡£¼ÙÉè
id=1
µÄÕâ±¾Êé¿â´æΪ
1
£ ......
À´×Ô: http://www.phpv.net/html/1666.html
#BEGIN CONFIG INFO
#DESCR: 4GB RAM, ֻʹÓÃInnoDB, ACID, ÉÙÁ¿µÄÁ¬½Ó, ¶ÓÁиºÔØ´ó
#TYPE: SYSTEM
#END CONFIG INFO
#
# ´ËmysqlÅäÖÃÎļþÀý×ÓÕë¶Ô4GÄÚ´æ
# Ö÷ҪʹÓÃINNODB
#´¦Àí¸´ÔÓ¶ÓÁв¢ÇÒÁ¬½ÓÊýÁ¿½ÏÉÙµÄmysql·þÎñÆ÷
#
# ½«´ËÎļþ¸´ÖƵ½/etc/my.cnf ×÷Ϊȫ¾ÖÉèÖÃ, ......
Ò»¡¢MySQL»ù±¾ÃüÁºÏ£º
1¡¢ create database mydata£»//´´½¨Êý¾Ý¿â
2¡¢ use mydata; //ÔÚmydataÕâ¸öÊý¾Ý¿âϹ¤×÷
3¡¢ create table dept //ÔÚmydataÊý¾Ý¿âÏ´´½¨±ídept
(
deptno int primary key,
dname varchar(14),
loc varchar(13)
);
create table emp / ......
MySQL½¨Á¢ÁÙʱ±íµÄÓï¾äÈçÏÂ:
CREATE TEMPORARY TABLE tmp (
article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
price DOUBLE(16,2) DEFAULT '0.00' NOT NULL);
--LOCK TABLES article read;
--ÏȲåÈëÊý¾Ýµ½ÁÙʱ±í
INSERT INTO tmp SELECT article, MAX(price) from shop GRO ......