SQL麻烦获取输出

时间:2015-10-05 04:44:50

标签: sql sql-server

查询似乎没有任何问题,但我的数据库没有输出。

SELECT 
    Salaries.playerID
FROM   
    Teams
INNER JOIN 
    Salaries ON  Teams.teamID = Salaries.teamID
WHERE  
    (Salaries.salary > (SELECT MIN(Salaries.salary)
                        FROM Salaries
                        INNER JOIN Teams ON Salaries.teamID = Teams.teamID
                        WHERE (Teams.name = 'Boston Red Sox')
                        GROUP BY Teams.name)
    )
    AND (Teams.name = 'Yankees')

1 个答案:

答案 0 :(得分:0)

我们假设您的表格中包含image-1以下数据,然后输出将为image-2

图片-1 enter image description here

图片-2 enter image description here