求一个简单的查询语句
A
----------------
id name info
----------------
1 aaa zzzzz
2 bbb xxxxx
3 ccc wwwww
+++++++++++++++++++++++
B
------------------
id name liuyan
------------------
1 aaa sdfsda
2 aaa sadfsd
3 ccc sasdaf
4 bbb sfasds
5 ccc sfdsfs
6 aaa sdsdfs
+++++++++++++++++++++++
要这样的查询结果 就是 一个留言表 一个用户信息表 取最新top10留言者的用户信息
zzzzz
wwwww
xxxxx
------解决方案--------------------SELECT TOP 10 * FROM yTABLE ORDER BY ID DESC
------解决方案--------------------select info from A t1
left join (select top 10 distinct name from B order by id desc ) t2
on t1.name=t2.name