mysql 查询 a大于b输出a,b大于c输出
-
1.方案一:
-
select
-
(case when a>b then a else b end ),
-
(case when b>c then b esle c end)
-
from 表名
-
2.方案二:
-
select if(a>b,a,b),if(b>c,b,c) from 表名
1.方案一:
select
(case when a>b then a else b end ),
(case when b>c then b esle c end)
from 表名
2.方案二:
select if(a>b,a,b),if(b>c,b,c) from 表名