Mysql中存储过程if else的问题简析_MySQL

WBOY
リリース: 2016-06-01 13:42:31
オリジナル
1410 人が閲覧しました

bitsCN.com
以下这样写会报错:
[Error] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end if' at line 8     create procedure test(in a int) if a > 1 then   select 1; elseif a>2 then   select 2; else  end if; [xhtml]create procedure test(in a int)  if a > 1 then    select 1;  elseif a>2 then    select 2;  else       end if;  应改成以下这样: create procedure test(in a int) if a > 1 then   select 1; elseif a>2 then   select 2; else -- do nothing -- set @tmp=1; end if;    作者 zhu473105308 bitsCN.com

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!