开发者

Mysql coding question

Is there an if or if else type s开发者_JAVA百科tatement for mysql.


There is an if else construct:

IF(value == x, 1, 0)

This returns 1 if value equals x and 0 otherwise.


As JoshD said, yes there is. Here is the reference in the MySQL Online Manual: http://dev.mysql.com/doc/refman/5.0/en/if-statement.html


There's an IF() function:

IF(expr1,expr2,expr3)

And an IF Statement.

IF search_condition THEN statement_list
    [ELSEIF search_condition THEN statement_list] ...
    [ELSE statement_list]
END IF
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜