I was facing this issue and the following query wasn't enoughwasn't enough
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
because I was using Stored ProcedureStored Procedure. After executing this query I had to drop my procedure and create againdrop the procedure and create again.