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
268 B
SQL

/*Write a SQL statement to find the highest purchase amount with their ID, for only those salesmen
whose ID is within the range 5003 and 5008.*/
SELECT salesman_id,MAX(purch_amt)
FROM orders
GROUP BY salesman_id
HAVING salesman_id BETWEEN 5003 AND 5008;