取出每行中最大的数, 显示成大致下面这个样子
求大神解答!
参考
http://blog.csdn.net/vipxiaotian/article/details/4409423
select if((select if(price1>price2,price1,price2))>price3,(select if(price1>price2,price1,price2)),price3)as price,id from t;
希望可以帮助楼主
--用Case语句也可以实际,如下:
select case when case when price1>price2 then price1 else price2 end>price3 then case when price1>price2 then price1 else price2 end else price3 end AS MaxPrice,id from t