select outbound.*,c.Jobnofrom outbound left join
(select * from outbounddetails a
where Id=(select MAX(Id) from outbounddetails b where b.caseno=a.caseno )) c
on outbound.caseno=c.caseno
左连接按条件取出一条数据
select outbound.*,c.Jobnofrom outbound left join
(select * from outbounddetails a
where Id=(select MAX(Id) from outbounddetails b where b.caseno=a.caseno )) c
on outbound.caseno=c.caseno
左连接按条件取出一条数据