a b c
1 3 5
2 8 10
33 20 18
我要得到a,b,c三个字段的最大值33
如何写sql语句
2 个解决方案
#1
select max(t.d) from
(
select a as d from tablename union
select b as d from tablename union
select c as d from tablename
)t
#2
知道了,谢谢你
#1
select max(t.d) from
(
select a as d from tablename union
select b as d from tablename union
select c as d from tablename
)t
#2
知道了,谢谢你