开发者

Mysql coding question

开发者 https://www.devze.com 2023-01-19 20:13 出处:网络
Is there an if or if else type s开发者_JAVA百科tatement for mysql.There is an if else construct:

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

精彩评论

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