programming-examples/sql/AggregateFunctions/Write a SQL statement to find the highest purchase amount on a date '2012-08-17' for each salesman with their ID.sql

5 lines
246 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*Write a SQL statement to find the highest purchase amount on a date '2012-08-17' for each salesman with their ID.*/
SELECT salesman_id,MAX(purch_amt)
FROM orders
WHERE ord_date = '2012-08-17'
GROUP BY salesman_id;