You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
355 B
SQL

/*Write a SQL statement to find the highest purchase amount with their ID and order date, for only those customers
who have a higher purchase amount in a day is within the list 2000, 3000, 5760 and 6000.*/
SELECT customer_id,ord_date,MAX(purch_amt)
FROM orders
GROUP BY customer_id,ord_date
HAVING MAX(purch_amt) IN(2000 ,3000,5760, 6000);