你用什么数据库,你是想用SQL语句实现还是用Delphi程序实现,几个字段是什么类型字段,请你把要求说清楚!

解决方案 »

  1.   

    字段的类型当然为整型,
    在 delphi 中动态sql 语句怎么写,
    如果SQL 不行,用delphi 怎么实现(别说用最复杂的取出来后,一个一个比较)
      

  2.   

    select max(字段)as 字段名 from 表名不会这么简单吧,大侠
      

  3.   

    select max(字段max)as 字段last from (
    select max(字段1)as 字段max from 表名 
    union
    ...
    union
    select max(字段n)as 字段max from 表名)
      

  4.   

    select case
           when q1<(case 
                    when q2<q3 then q3
                    else q2
                    end ) 
                    then (case 
                          when q2<q3 then q3
                          else q2                   
                          end )                    
           else q1
           end result2
    from table1如果多予3个字段,就用case语句替换q3,依此类推