Executed Query -> select t.* from (select distinct artist.id as artistid, artist.avatar, artist.gender, artist.is_plan_active, artist.plan_expiry_date, artist.profile_pic_name, sampl.id as sampleid, sampl.createddate, sampl.sampletitle, sampl.samplefile, cat.categoryname as category, lang.languagename as language, info.voicepriceforbase, info.voicehourtatforbase, info.voicemintatforbase from tbl_users as artist left join tbl_artist_samples as sampl on artist.id = sampl.artistid left join tbl_artist_info as info on artist.id = info.artistid left join tbl_category as cat on sampl.categoryid = cat.id left join tbl_languages as lang on sampl.languageid = lang.id where artist.usertype = "a" and artist.isactive = "y" and artist.is_artist_profile_approved = "a" and sampl.isapproved = "y" and sampl.isactive = "y" and sampl.artistid != "0" and (lang.slug = "tunisian-arabic") order by artist.id ) as t group by t.artistid order by t.is_plan_active
ERROR:"SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 't.sampleId' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by: 398"