I’m trying to get the prod_cat
s whose average
of total_amt
is greater than the overall average of total_amt
.
Here is my updated code:
SELECT P.prod_cat, AVG(total_amt) AS average
FROM Transactions T JOIN
prod_cat_info P
ON T.prod_cat_code = P.prod_cat_code
GROUP BY prod_cat
HAVING average > (SELECT AVG(total_amt) FROM Transactions)
I’m trying to get the prod_cat
s whose average
of total_amt
is greater than the overall average of total_amt
from the Transactions
table.