表一:  game
ID   Title表二: weblink
ID  gameid表三:tableC
ID Title  weblinkID三者关系是:  表一和表二  1对多  [gameid]关联起来
                    表二和表三  1对多  [weblinkID]关联起来
现在我要查表三的前十条记录, 满足的条件是 记录都在 表一的某条记录名下.... 排列顺序是按ID排列..  大致是下面的意思  只是我写的是错的。
希望能指点下
Select top 10 * from tableC  where  weblinkID in (select id from weblink where gameid=110) order by ID desc

解决方案 »

  1.   


    select top 10 * from tablec c
    inner join weblink b on c. weblinkID=b.id
    inner join game  a on b.gameid=a.id and a.id=110
    order by c.id desc
      

  2.   


    select top 10 * from game a,weblink b,tableC c where a.gameid=b.gameid and b.weblinkID = c.weblinkID and b.gameid=110 order by c.id desc