Full Group By mode unable to configure

Hi,
Getting the following error when using group by with joins.
SELECT list is not in GROUP BY clause and contains nonaggregated column.

Unable to issue the command -
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,‘ONLY_FULL_GROUP_BY’,‘’))

Pls help I need this for lesser code in my application.