try:
  select * from table1 (select a,b,min(c) from asd group by a,b)t 
      where table1.a = t.a
        and table1.b = t.b
        and table1.c = t.c

解决方案 »

  1.   


    select *  from table1 a where a.c=(select min(c) from table1  b where a.A=b.A and a.B=b.B);
      

  2.   

    select * from table1 where (a,b,c) in (select a,b,min(c) from asd group by a,b)
    你的语句有什么错误?
    我写了个类似的运行没问题啊
      

  3.   

    这里还有一个问题大家都没有考虑到!就是数据结构,请问,如果都是varchar2你们怎么比较?两种情况:
      1). c  number
            select * from table_name a
                   where a.c=( select min(b.c) from table_name b
                                 where a.A=b.A and a.B=b.B);
      2). c  varchar
            需要对子查询中的数据进行一下转换才能比较
      

  4.   

    正如bzszp(SongZip)所说,
    select * from asd where (a,b,c) in (select a,b,min(c) from asd group by a,b) 
    就好用,第一次是我写错了一个字母,完了之后发帖子时又改了回来,但没有重新试.
    麻烦大家了,谢谢!