不用嵌套SQL,排序後取第一行值

  select
   min(TC_APSMB002)keep(dense_rank first order by tc_apsmc004-tc_apsmc005 DESC),
   min(tc_apsmc004-tc_apsmc005)keep(dense_rank first order by tc_apsmc004-tc_apsmc005 DESC)  

 from

   ds4.tc_orc_file
  ,ds4.tc_apsmb_file,ds4.tc_apsmc_file
  where tc_orc008=tc_apsmb001
    and tc_ORC008=tc_apsmc002
    AND TC_ORC009=TC_APSMC001

posted on 2011-12-09 09:26  Mayvar  阅读(656)  评论(0编辑  收藏  举报

导航