Executed Query -> select distinct timestampdiff(year, artist.birthdate, curdate()) as difference,group_concat(distinct(lang.languagename)," ") as languages,artist.firstname as firstname,artist.lastname as lastname,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.sampleposition,sampl.samplefile,city.cityname,country.countryname,country.countryid,cat.categoryname as category, (select case when id > "0" then "y" else "n" end as isfav from tbl_favorite_artist where userid = "0" and artistid = artist.id) as isfav, info.studio_name,info.studio_rental_cost_per_hour,info.rating,info.studioid from tbl_users as artist left join tbl_studiopic_samples as sampl on artist.id = sampl.studioid left join tbl_studio_info as info on artist.id = info.studioid left join tbl_studio_category as art_cat on art_cat.studioid = artist.id left join tbl_studiop_category as cat on art_cat.categoryid = cat.id left join tbl_studio_language as art_lan on art_lan.studioid = artist.id left join tbl_languages as lang on art_lan.languageid = lang.id left join tbl_city as city on city.cityid = info.city left join tbl_country as country on country.countryid = info.country where artist.usertype = "s" and artist.isactive = "y" and artist.is_artist_profile_approved = "a" and sampl.isapproved = "y" and sampl.isactive = "y" and sampl.studioid != "0" group by sampl.id order by artist.is_plan_active asc
ERROR:"SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #15 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'voyzapp_dblive2.city.cityName' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by: 344"