programming-examples/sql/AggregateFunctions/Write a SQL statement to find the highest purchase amount with their ID, for only those customers whose ID is within the range 3002 and 3007.sql
2019-11-18 14:05:53 +01:00

6 lines
269 B
SQL

/*Write a SQL statement to find the highest purchase amount with their ID, for only those customers whose ID is within
the range 3002 and 3007.*/
SELECT customer_id,MAX(purch_amt)
FROM orders
WHERE customer_id BETWEEN 3002 and 3007
GROUP BY customer_id;