The following SQL works fine in MySQL 5.6:
SELECT 10 AS total, (SELECT total * 10) AS cost
However, in MySQL 5.7, this gives the following error:
Unknown column 'total' in 'field list'
I am sure this is due to ONLY_FULL_GROUP_BY , but I am not sure how I can fix what you received.
Can anybody help?
source share