6 lines
254 B
SQL
6 lines
254 B
SQL
/*12. Write a query to find all orders with order amounts which are above-average amounts for their customers..*/
|
|
SELECT *
|
|
FROM orders a
|
|
WHERE purch_amt >
|
|
(SELECT AVG(purch_amt) FROM orders b
|
|
WHERE b.customer_id = a.customer_id); |