我有疑问,需要简化。但是不知道如何。我该怎么办?
SELECT city, SUM(weight) FROM Details
WHERE city = 'London' OR city = 'Paris'
GROUP BY city;
GO
SELECT * FROM Employees
WHERE Department = 'sales' OR Department = 'supply'
GO
SELECT * FROM Employees
WHERE (Department = 'sales' OR Department = 'supply') AND Salary >= 6000;
GO
答案 0 :(得分:0)
您可以使用IN
:
SELECT city, SUM(weight) FROM Details
WHERE city IN ('London', 'Paris')
GROUP BY city;
SELECT * FROM Employees
WHERE Department IN ('sales', 'supply');
SELECT * FROM Employees
WHERE Department IN ('sales', 'supply') AND Salary >= 6000;
答案 1 :(得分:0)
您可以使用IN
WHERE city IN ('London','Paris')
GROUP BY city;
GO
WHERE Department IN ('sales','supply')
GO