I want to get an average of Customers total purchase and store it in @x
Then I want to store an average of Supplier total purchase and store it in @y
And then do some comparisons, It would be nice if anyone can help out.
Advertisement
Answer
it is quite hard to navigate your tables so i ll just post an example of something similar i did with my project:
SELECT (SELECT AVG(amount) FROM `vw_on_report`) as x, (SELECT AVG(amount) FROM `vw_off_report`) as y