以下是我的数据库设计课程问题,我无法找到获得我想要的结果的方法。
- ME.9对于第4场比赛,如果我登陆前10个位置之一,我可以买哪些?价格是多少?
- 列出order_site,网站名称,价格
- 答案:( 4行,3列)
SELECT site.order_site, site.site_label, site.price
FROM game_player
JOIN game
ON game.game_id = game_player.game_id
JOIN game_player_owns_site
ON game_player_player_id = game_player.player_id
JOIN site
ON site_order_site = order_site
WHERE game.game_id = 4
AND site.order_site <= 10
AND site.is_ownable = 1;
结果是一个2x3的虚拟表,但应该是4x3,不包括当前显示的结果。数据库生成器如下:Pastebin