俺看你的结果集,没有必要到tab2表检索记录啊。。

解决方案 »

  1.   

    回复人: ATGC(这一生受了很多委屈吃了很多苦。。) 
    ===========================有必要啊对不起...我可能没有说清楚要求........
    既要按tab1中的write也要按tab2中的man_sn做排序啊......
      

  2.   

    那你就是要TBL2中man_sn最小的那条是吧?
      

  3.   

    对不起....可能我说的要求还不够明白...
    ....
    .....我要的是:由于在tab1中的一条记录,可能对应tab2中的几条记录(当然user_no值是相同的.只是有某些值不同.如:man或man_sn),我只想显示tab1对应tab2中相同的user_no的一条记录.....
      

  4.   

    select * from tab1,
    (select * from tab2 where rowid in
    (select max(rowid) from tab2 group by user_no)
    ) t2
    where tab1.user_no=t2.user_no;
      

  5.   

    select b.* from tab1 a,tab2 b where a.user_no = b.user_no and rownum = 1;
      

  6.   

    select a.user_no,max(a.name),max(a.write)  from  tab1 a , tab2 b
              where a.user_no=b.user_no  
    group by a.user_no
        order by a.write,b.man_sn