楼上的,不清楚我说的什么意思吗?就是取字段名。另外我说下agentid是主键。
select ······· from talbe where agentid =1000;
请哪位把········处补齐。

解决方案 »

  1.   

    select distinct 't01' as col from talbe where agentid =1000 and t01=2
    union all
    select distinct 't02' as col from talbe where agentid =1000 and t02=2
    union all
    select distinct 't03' as col from talbe where agentid =1000 and t03=2
    /
      

  2.   

    select decode(t01,2,'t01','') as t01,
    decode(t02,2,'t02','') as t02,
    decode(t03,2,'t03','') as t03
    from table where ...
    试试
      

  3.   

    select column_name from all_tab_columns where table_name='表名'