Hello,
from invoices
select [avg_price = avg total]
generates
SELECT
AVG(total) OVER () AS avg_price
FROM
invoices
This query returns the average price. But not once, but n times, where n is the number of rows in the table.
I would expect instead:
SELECT
AVG(total) AS avg_price
FROM
invoices