oracle sql inner join 问题
发布网友
发布时间:2022-04-21 03:21
我来回答
共1个回答
热心网友
时间:2022-04-13 07:33
select a.id,a.name,c.fid,c.address,c.time
from A
left join (
select fid,address,time
from (select fid,address,row_number() over (partition by fid order by time desc) rn from B)
where rn=1
) c on a.id=c.fid
where a.id=1
;追问rn=1 是什么意思?
追答rn 是用来排序的编号