自己写代码来判断
try:
Select (case when T1>=T2 then (case when T1>=T3 then T1 else T3 end) else (case when T2>=T3 then T2 else T3 end) end) from 表

解决方案 »

  1.   

    同意马可 :)如果你想求出该表中最大的值,则可为
    select max(col)from 
    (
    select max(T1) col from tab union 
    select max(T2) col from tab union
    select max(T3) col from tab 
    )
      

  2.   

    select max(a)
    from
    ( select max(T1) a from 
      union
      select max(T2) a from 
      union
      select max(T3) a from
    )
      

  3.   

    select max(a.col)from 
    (
    select T1 col from yourtable union 
    select T2  from yourtable union
    select T3  from yourtable 
    ) a
      

  4.   

    select top 1 *
    from 
    (
    select T1,t2 from yourtable union all
    select T1,t2  from yourtable union all
    select T1,t2  from yourtable 
    ) a order by t1 desc
      

  5.   

    union all 不要 union它们的结果和效率都是不同的。