select 表2.name,表2.adds,表2.type,max(表1.date) as [date]
from 表1,表2
where 表1.name=表2.name
group by 表2.name,表2.adds,表2.type
from 表1,表2
where 表1.name=表2.name
group by 表2.name,表2.adds,表2.type
调试欢乐多
select * from 表1 a
where not exists(select 1 from 表1 where name=a.name and seq_no>a.seq_no)) b
inner join 表2 c
on b.name=c.name
from 表2 b,
(select name,max(date) as date
from 表1
group by name) a
where a.name = b.name