select decode(c,0 ,a ,1 ,b ) from table

解决方案 »

  1.   

    SQL SERVER/ SYBASE:SELECT E = 
      CASE  
        WHEN C = 0 THEN A
        WHEN C = 1 THEN B
      END
    FROM TABLE_1
      

  2.   

    ORACLE:
      SELECT DECODE(C, 0, A, 1, B) E FROM TABLE_1
     
      

  3.   

    select A as E from YourTable where C=0
    union
    select B as E from Yourtable where C=1
      

  4.   

    select (case when C=0 then A else B end) as E from tablename
      

  5.   

    foxselect iif( C=1, A, B) as E from Table_1
      

  6.   

    标准Sql
    select A from table
    where c=0
    union
    select B from table
    where c=1
      

  7.   

    标准Sql应该是:
    select A from table
    where c=0
    union All
    select B from table
    where c=1
      

  8.   

    select A as E from YourTable where C=0
    union
    select B as E from Yourtable where C=1
      

  9.   

    我用的是access,谢谢各位,晚上验证了,明天给大家分。