Answer the question
In order to leave comments, you need to log in
How to solve a SQL problem?
task description:
The database table contains the following columns:
Sales(Date, ProdID, OrderID, ManagerID, Sum)
Write an SQL query that will show the manager with the highest sales for specific orders in 2019 (by months).
The query must return the Month, Manager (ManagerID), Order Numbers (OrderID) and Sum.
My decision:
SELECT MONTH(DATE), ManagerID AS Менеджер, OrderID AS Номера заказов, max(Sum) AS Сумма
FROM Sales
WHERE Sum = max(Sum) and YEAR(DATE) = 2019;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question