Oracle在select中写入子查询并限制唯一

发布时间 2023-03-22 21:09:31作者: 无产铁锤
select ta.*,
          (select filed1
               from (select row_number() over(partition by tt.fl_id order by tt.fd_date desc) fl_rn, tt.fl_id, filed1 from table_name2 tt) tf
              where tf.fl_id = ta.fl_id
                 and fl_rn = 1
            )  filed1
from table_name ta