YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* 条件分岐 [#v7c6503d]
** case [#he97be3b]
SELECT CASE 1 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "...
** if [#h5444675]
SELECT IF(2>1, 'YES', 'NO'); --'YES'
UPDATE users SET class = IF(age >= 20, 'adult', 'child');
** 参考 [#a965604e]
- http://dev.mysql.com/doc/refman/4.1/ja/control-flow-fun...
- http://dev.mysql.com/doc/refman/5.1/ja/control-flow-fun...
終了行:
* 条件分岐 [#v7c6503d]
** case [#he97be3b]
SELECT CASE 1 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "...
** if [#h5444675]
SELECT IF(2>1, 'YES', 'NO'); --'YES'
UPDATE users SET class = IF(age >= 20, 'adult', 'child');
** 参考 [#a965604e]
- http://dev.mysql.com/doc/refman/4.1/ja/control-flow-fun...
- http://dev.mysql.com/doc/refman/5.1/ja/control-flow-fun...
ページ名: