I am using this query:
Code:
select category, '$'||sum(cost)AS "Total Retail" ,'$'||avg(cost) as "Average Retail" from books group by category having sum(cost)>40;
I also tried this query and I got an ERROR of group function not allowed here:
Code:
select category, '$'|| sum(cost) as "Total Retail",'$'|| avg(cost) as "Average Retail" from books WHERE sum(cost)>40;
And this is returning 3 results....the correct query should return 4 results. Can someone point out where my error is?
****Disregard I was using the wrong field name for the sum/avg....Simple mistakes make life hell from time to time