I have a grid app. I want only the chart from a summary (the only documented way to get a chart).
SELECTWhen I execute the app, the SQL has been changed to:
ROUND(AVG(Order_Total), 2) AS Avg_Order,
WHERE Order_Date > (NOW() - INTERVAL 6 MONTH)
GROUP BY Customer_ID
ORDER BY Avg_Order DESC
selectThe field "Customer_ID" (and LIMIT 20, and a random avg() thrown in) have been dropped, making the SELECT fail due to an invalid GROUP BY.
avg(ROUND(AVG(Oder_Total),2)) as avg_order
where Order_Date > (NOW() - INTERVAL 6 MONTH)
group by Customer_ID