i needed a derived table, as the original data came from a view that had a sum of the sales per day, and i needed to get the count of days that had a non-zero value, then get the avg sales from that to the total sales of all the days queried.
original sql (mockup, not real table):
select...
Having a bit of trouble trying to get the data exactly how i need it. anyone know why sql throws an error on this?
Select count(select sum(sales) from actsales groupby salesdate) from actsales innerjoin ~.....
the error is on the select inside the count, says its invalid.
thanks in advance...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.