MYSQL query error

0

I have the following query

select DISTINCT(p.id),g.id, p.slug, p.nome
from game g
join game_plataforma gp on g.id=gp.id_game
join plataformas p on gp.id_plataforma=p.id
group by g.id,p.id,p.slug, p.nome
order by g.id DESC
limit 5;

She returns this here

I have tried in many ways but I do not think the error.

I want to list the platforms in descending order by the game date. It almost does this but I want to group or in case show different, so my list should be

xbox
play4
nintendo3ds

and would only show these 3

I changed to

    select DISTINCT(p.id), p.slug, p.nome
from game g
join game_plataforma gp on g.id=gp.id_game
join plataformas p on gp.id_plataforma=p.id
group by p.nome
order by g.id DESC
limit 5

and gave this error

#1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'desapego.p.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

link in fidle works

    
asked by anonymous 19.11.2016 / 23:09

0 answers