日期:2014-05-17 浏览次数:20622 次
select a.*,b.name,b.data
from 主表 as a
inner join 从表 as b on a.ID=b.v_id
where not exists(select 1 from 从表 where v_id=b.v_id and id>a.id)
select a.*,b.name,b.data
from 主表 as a
inner join 从表 as b on a.ID=b.v_id
where not exists(select 1 from 从表 where v_id=b.v_id and [date]>a.[date])