select distinct columns from table; ;
这种问题随便找本sql的书看都有啊。

解决方案 »

  1.   

    SQL>select a.col_1,b.col_2,b.col_3...
    SQL>from (select distinct col_1 from table_name) a,table_name b
    SQL>a.col_1=b.col_1;
      

  2.   

    所有列都查,那就得进行分组,假设两列:
    SELECT DISTINCT A1,A2 FROM TABLE GROUP BY A1,A2
      

  3.   

    select * from dual a where a.rowid = (select rowid from dual b where b.colname = a.colname and rownum = 1)
      

  4.   

    SELECT A1,A2 FROM TABLE GROUP BY A1,A2
      

  5.   

    create or replace pro
    is 
    vrow tab%rowtype;
    cursor curb(va tab.col%type) is select * from tab;
    cursor cura is select distinct col from tab;
    begin
    for curarec in cura loop
    open curb(curarec.col);
    fetch curb into vrow;
    close curb;
    dbms_output.put_line(vrow.col-1||vrow.col-2||.......||vrow.col-n);
    end loop;
    end pro;
    我不知道当某列有重复值
      

  6.   

    时,该显示那一列,我显示的第一列;
    而且,你应该用rpad()函数使显示更加象报表