1. select 
     (select count(distinct(Field_1)) from table_1 where Field_3='1')+
     (select count(distinct(Field_2)) from table_1 where Field_3='2) cnt
    from dual;2.select 
    count(distinct(decode(Field_3,'1',Field_1))) +
    count(distinct(decode(Field_3,'2',Field_1))) cnt
   from Table_1;3.假定Field_1,Field_2中都不含有字符 '*',还可以使用
  select
    count(distinct(decode(Field_3,'1','*' || Field_1, Field2))) cnt
   from Table_1;

解决方案 »

  1.   

    select a.sum1,b.sum2 from (select count(distinct(Field_1)) as sum1 from table_1 where Field_3='1') a,(select count(distinct(Field_2)) as sum2 from table_1 where Field_3='2') b
    没试过,应该行
      

  2.   

    1. select 
         (select count(distinct(Field_1)) from table_1 where Field_3='1')+
         (select count(distinct(Field_2)) from table_1 where Field_3='2) cnt
        from dual;
    能不能说明一下:cnt是什么意思?dual是什么意思?
      

  3.   

    1. select 
         (select count(distinct(Field_1)) from table_1 where Field_3='1')+
         (select count(distinct(Field_2)) from table_1 where Field_3='2) cnt
        from dual;
    能不能说明一下:cnt是什么意思?dual是什么意思?
    呵,,知道了,不好意思,这么简单扼要!
      

  4.   

    1、select count(distinct(Field_1)) from table_1 where Field_3='1'
    2、select count(distinct(Field_2)) from table_1 where Field_3='2'select sum(decode(Field_3,'1',