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

mysql ÀÛ¼ÓÔËËã - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql

sp ³ÌÐò

delimiter //
create procedure ma()
begin
declare i int default 0;
while i<11 do
set i=i+1;
select i;
end while;
end //
delimiter ;


1+2+...+9+10

ΪʲôÕâ¸ö³ÌÐòÎÞ·¨ÊµÏÖÀÛ¼ÓЧ¹û

//Çë˵Ã÷Õâ¸ö³ÌÐòµÄȱÏݺ͸Ľø·½·¨¡£¡£Ð»Ð»¸÷λ´ó¸ç

SQL code:
mysql> call ma();
+------+
| j |
+------+
| 55 |
+------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)


˳±ãÎÊÒ»ÏÂ
SQL code:
delimiter //
create procedure test07()
begin
declare i int ;
set i=1; --Õâ¸öµØ·½ÉèÖóÉi=1 ¿ÉÒÔÊäÈëµã¶«Î÷¡£¡£µ«ÊÇi=0ΪʲôÊÇÎÞÏÞÑ­»·£¿
while i<10 do
set i=i+1;
select i;
end while;
end //
delimiter ;



º¹£¬Äã±¾ÉíµÄ³ÌÐòÊÇÍù±äÁ¿IÒ»Ö±ÀÛ¼Ó1¡£ ×Ðϸ¿´Ï¾ÍÃ÷°×ÁË¡£


Ïà¹ØÎÊ´ð£º

netbeans Á¬mysql - Web ¿ª·¢ / HTML(CSS)

ÎÒÓõÄÊÇÁ¬½Ó³Ø×öµÄ£¬ÅäÁ¬½Ó³ØµÄ·½·¨Ó¦¸ÃûÓÐ´í£¬ÎªÊ²¾ÍÊdzöÏÖÕâÖÖÎÊÌâ
javax.servlet.ServletException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/test
ÇëÎÊ´óÏÀÃÇÕâÊÇÔ ......

mysqlÎÊÌ⣡ - Java / Java SE

String sqlCount="select count(*) from usertable where username='"+
userName+"'";Õâ¾ä»° ʲôÒâ˼°¡£¡
Õâ¾ä»°Êä³ö³öÀ´¾ÍÊÇ
select count(*) from usertable where username='ÄãµÄ±äÁ¿ ......

mysqlÔ¤´¦Àí - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql

SQL code:

create procedure proc_batchUpdate(in categoryId integer , in artIds varchar(50))
begin
set @dsql = count('update article set type=' , categoryId , ' where id in (' , artIds , ' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ