mysql¹ý³ÌÓαê
DELIMITER $$
DROP PROCEDURE IF EXISTS `heli`.`prodtest` $$
CREATE PROCEDURE `heli`.`prodtest` ()
BEGIN
/*¾Ö²¿±äÁ¿µÄ¶¨Òå declare*/
declare pid varchar(45) default '';
declare pq int default 0;
declare pk double default 0.0;
declare cur1 CURSOR FOR SELECT product_id,product_quantity,product_kg from productstock;
/* ÓαêÒì³£ºóÉèÖÃpidΪNULL */
declare CONTINUE HANDLER FOR SQLSTATE '02000' SET pid = null;
/*¿ªÓαê*/
OPEN cur1;
FETCH cur1 INTO pid,pq,pk;
WHILE (pid is not null) DO
/* dosomething */
select pid,pq,pk;
FETCH cur1 INTO pid,pq,pk;
END WHILE;
CLOSE cur1;
END $$
DELIMITER ;
Ïà¹ØÎĵµ£º
ǰÑÔ£º
±¾ÎIJûÊöµÄÊÇÒ»¿î¾¹ýÉú²ú»·¾³¼ìÑéµÄǧÍò¼¶Êý¾ÝÈ«ÎļìË÷£¨ËÑË÷ÒýÇæ£©¼Ü¹¹¡£±¾ÎÄÖ»Áгöǰ¼¸ÕµÄÄÚÈݽÚÑ¡£¬²»ÌṩȫÎÄÄÚÈÝ¡£
ÔÚDELL PowerEdge 6850·þÎñÆ÷£¨ËÄ¿Å64 λInter Xeon MP 7110N´¦ÀíÆ÷ / 8GBÄڴ棩¡¢RedHat AS4 Linux²Ù×÷ϵͳ¡¢MySQL 5.1.26¡¢MyISAM´æ´¢ÒýÇæ¡¢key_buffer=1024M»·¾³ÏÂʵ²â£¬µ¥±í1000ÍòÌõ¼Ç ......
¸ÅÊö
1.PHP ÊÇʲô£¿
PHP ÊÇ·þÎñÆ÷¶Ë½âÊ͵Ľű¾ÓïÑÔ£¬ËüÊÇĿǰ×îÁ÷ÐÐµÄ web ±à³ÌÓïÑÔÖ®Ò»¡£ ÔÚÒ»¸ö HTML Ò³ÃæÖпÉÒÔǶÈëPHP´úÂ룬ÕâЩ´úÂëÔÚÿ´ÎÒ³Ãæ·ÃÎÊʱִÐС£PHP ´úÂ뽫ÔÚ Web ·þÎñÆ÷Öб»½âÊͲ¢ÇÒÉú³É HTML»òÕß·ÃÎÊÕß¿´µ½ÆäËûÊä³ö½á¹û¡£
2.My SQL ÊÇʲô£¿
My SQL ÊÇ»ùÓÚ SQL µÄÍê ......
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµÄuser±í£¬²»¹ý±ðÍüÁËʹÓÃPASSWORDº¯Êý¡£
·½·¨¶þ
ʹÓÃmysqladmin£¬ÕâÊÇÇ°ÃæÉùÃ÷µÄÒ»¸öÌØÀý¡£
mysqladmin -u root -p password mypasswd
ÊäÈëÕâ¸öÃüÁîºó£¬ÐèÒªÊäÈërootµÄÔÃÜÂ룬ȻºórootµÄÃÜÂ뽫¸ÄΪmypasswd¡£
°ÑÃüÁîÀïµÄroot¸ÄΪÄãµÄÓû§Ãû£¬Äã¾Í¿ÉÒ ......
MySQLÒ×ѧÒ×Óã¬ÇÒ¸½´ø·á¸»µÄ¼¼ÊõÎĵµ£¬Õâ¶þ¸öÒòËØÊ¹Ö®±»¹ã·ºÓ¦Óá£È»¶ø£¬Ëæ×ÅMySQL·¢Õ¹Ö®Ñ¸ËÙ£¬¼´Ê¹Ò»¸öMySQLÀÏÊÖÓÐʱҲ»áΪ¸ÃÈí¼þ³öÆä²»ÒâµÄ¹¦ÄܸÐ̾¡£±¾ÎĽ«ÎªÄã½éÉÜÕâЩ²»ÎªÈËÖªµÄÌØÐÔ¡£
ÒÔXML¸ñʽ²é¿´²éѯ½á¹û
ͨ¹ýʹÓô«Í³—xml
Ñ¡Ïîµ÷ÓÃMySQLÃüÁîÐпͻ§³ÌÐò£¬Äã¿ÉÒÔÒÔXML¸ñʽ(¶ø²»ÊÇ´«Í³µÄÁбíÐÎʽ)À´²é¿´M ......
×î½üÔÚMySQLÉÏ×öÁ˵㹤×÷£¬·¢ÏֺܶàÈ˶¼ÔÚѯÎÊMySQLǶÌײéѯµÄÎÊÌ⣬Ðí¶àÈ˶¼¾õµÃMySQL²»Ö§³ÖǶÌײéѯ£¬ÆäʵMySQl´Ó4.11°æºóÒѾÍêȫ֧³ÖǶÌײéѯÁË£¬ÄÇôÏÂÃæÎÒ¾ÙЩ¼òµ¥µÄǶÌײéѯµÄÀý×Ó°É£¨Ô´³ÌÐòÀ´×ÔMySQL User Manual£©£º
1. SELECTÓï¾äµÄ×Ó²éѯ:
Óï·¨: SELECT ... from (subquery) AS name ...
ÏÈ´´½¨Ò»¸ö±í:
......