mysql ¸Ä¸öº¯Êý - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql
create table treeNodes
(
id int primary key,
nodename varchar(20),
pid int
);
CREATE FUNCTION `getChildLst`(rootId INT)
RETURNS varchar(1000)
BEGIN
DECLARE sTemp VARCHAR(1000);
DECLARE sTempChd VARCHAR(1000);
SET sTemp = '$';
SET sTempChd =cast(rootId as CHAR);
WHILE sTempChd is not null DO
SET sTemp = concat(sTemp,',',sTempChd);
SELECT group_concat(id) INTO sTempChd from treeNodes where FIND_IN_SET(pid,sTempChd)>0;
END WHILE;
RETURN sTemp;
END
Õâ¸öÊDzé³öËùÓÐ×Ó½Úµãid $,1,2,3,4,5,6,7
ÎÒÏëÒª²é³öËùÓи¸±²½Úµãid £¬Éî¶ÈΪ10 (¾ÍÊÇÖ»²é10¸ö¸¸±²½Úµã)£¬Èç¹û³¬¹ý10¸öºóÃæµÄ¾Í²»²é²»À´
ɾ³ý½á¹û '1','2','3','4'
½¨ÒéÄãÁгöÄãµÄ±í½á¹¹£¬²¢Ìṩ²âÊÔÊý¾ÝÒÔ¼°»ùÓÚÕâЩ²âÊÔÊý¾ÝµÄËù¶ÔÓ¦ÕýÈ·½á¹û¡£
²Î¿¼Ò»ÏÂÕâ¸öÌù×ÓµÄÌáÎÊ·½Ê½http://topic.csdn.net/u/20091130/20/8343ee6a-417c-4c2d-9415-fa46604a00cf.html
1. ÄãµÄ create table xxx .. Óï¾ä
2. ÄãµÄ insert into xxx ... Óï¾ä
3. ½á¹ûÊÇʲôÑù£¬£¨²¢¸øÒÔ¼òµ¥µÄËã·¨ÃèÊö£©
4. ÄãÓõÄÊý¾Ý¿âÃû³ÆºÍ°æ±¾(¾³£ÓÐÈËÔÚMS SQL server°æÎÊ MySQL)
&nbs
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏÂÄܲ»ÄÜÔÙwindows϶¨ÆÚÇå¿ÕmysqlÒ»¸ö±íÖеÄÈ«²¿Êý¾Ý£¬ÓÃPHPʵÏÖ£¡
лл¸÷λÁË
¾Í±ÈÈçÒ»¸öÐÇÆÚÇå¿ÕÒ»´Î
±ÈÈçÿ¸öÐÇÆÚÁùÁãµãÇå¿ÕÒ»´Î£¡
ллÁË
¼Æ»®ÈÎÎñ...php....sql...truncate....OK
Äã¾ÍÕâ½ÓÔÚҳà ......
ÎÒÒѾ°´Õս̳ÌÉÏÅäÖÃtomcatµÄserver.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......
¸Õ¸Õ½Ó´¥MySQL,²»ÖªµÀ¸ÃÈçºÎÈ¥²é¿´Êý¾Ý£¬²åÈëÊý¾Ý£¬´´½¨Êý¾Ý¿â¡¢±í£¬ÓÃÄÄΪǰ±²ÄÜÖ¸½ÌÒ»¶þ£¿
MySQL 5.1²Î¿¼ÊÖ²á
ÒýÓÃ
ÐÖµÜÄã»á½áÌùÂð£¿
mysql ²Î¿¼ÊÖ²á
baidu
MySQL¹Ù·½Îĵµ http://dev.mysql.com/doc ......
id name datetime
1 a 2010-05-13 10:15:00
2 b 2010-05-14 09:10:00
3 d 2010-05-14 10:10:00
ÈçºÎ½«¾àÀëÄ¿Ç°×î½üµÄÄǸö¼Ç¼µÄname ¸üÐÂΪ¡°x¡±ÄØ
лл¿© °¡ ºÇºÇ
update table_n ......
ÔÚmysql´æ´¢¹ý³ÌÖж¨Òå±äÁ¿ºÍ²ÎÊýʱ¿ÉÓпÉÎÞ·ûºÅ@£¬ÇëÎÊÓÐ@ºÍûÓÐ@ÓÐʲôÇø±ð£¿Ð»Ð»£¡
create procedure mypro()
begin
declare @temp int;
set @temp=3;
end //
´´½¨Õâ¸ö´æ´¢¹ý³ÌµÄʱºòΪʲô»á±¨´íÄØ£¿
......