随笔记录
Mysql-ifnull,if语句
2015-12-17 diaba


取某行数据多个数值字段最大的一个值



select 
if(field1>field2,field1,field2) as bigger,
if(if(field1>field2,field1,field2)>if(field3>field4,field3,field4),if(field1>field2,field1,field2),if(field3>field4,field3,field4)) as biggest
from dual;

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容