Query Help to determine average price for products < 3

459 Views Asked by At

Hi I've been working on this query, and I can't quite figure out the where statement to show only the average price of products < 3

"List each Product Class, number of items in the class and the average Price (name this Avg_Price, Format $0.00) of the items in the class. List only those classes that have less than three (3) items"

This query shows me the results of the average prices of the products (results in image) COLUMN Avg_Price FORMAT $999,999.00 SELECT Product_Class, COUNT(*), AVG(Price) AS Avg_Price FROM Product GROUP BY Product_Class;

enter image description here

I need help only showing the counts avg PRICE that is < 3

1

There are 1 best solutions below

0
Juan Carlos Oropeza On

Include Having at the end

  HAVING count(*) > 3