select a,count(*) from table group by a
如果记录集合多于1就是又不同的

解决方案 »

  1.   

    select count(*) into a from table group by a
    if a >0 then --有相同的值
      

  2.   

    Declare
      A  Number;
    Begin 
      Select Count(*) 
        Into A
        From Table
        Group by A;
        
        IF A>1 Then
         dbms_output.put_line('The same result!');
         elsif A=0 Then
         dbms_output.put_line('The different result!');
       End IF;
    End;