mysql if()函数

 在mysql中

IF(expr1,expr2,expr3),如果expr1的值为true,则返回expr2的值,如果expr1的值为false,

则返回expr3的值。

例:

select * from a_onelayer where if(id !='',id='1',1=1) 

猜你喜欢

转载自www.cnblogs.com/cjb1/p/9707468.html