select case when A > B then A else (case when B>C then B else C end) end from 表
select case when case when a>b then a esle b end > c then case when a>b then a esle b end esle c end from 表