--合并两个关联表的字段
SELECT [GROUP_TOPICS].*,[GROUP].[Name] FROM GROUP_TOPICS INNER JOIN [GROUP] ON GROUP_TOPICS.GROUPID=[GROUP].GROUPID WHERE POSTERID=77
--相同行数据只取其中一条
SELECT top 100 * FROM (SELECT *,ROW_NUMBER() over(partition by tid ORDER BY pid DESC) rnum FROM group_posts where PosterID=77) AS A WHERE rnum=1