So here: Select jornada from jogos -> I will get all the data from this columnAnd here: Group by jornada -> I will group all the common data in one simple record.And here: Order by min(id) -> I'm saying for it showing all the agregated groups by min ID