用PL/SQL编写过程,然后在程序中调用,看看可以吗。

解决方案 »

  1.   

    使用SQL语句就可以得到这样的记录。
    select * from (select * from table1 group by A) order by A
    where rownum=1你试试。
    如果要在程序里面返回这个数据集,就需要使用游标了。
      

  2.   

    使用子查询吧:select A,B from (
      select A,B,row_number() over(patition by A order by B) as id from table
    )
    where id=1
    (注意:row_number()函数816以上版本支持)
      

  3.   

    select * from tablename where rowid in (select Min(rowid) from tablename group by a) ;