1
I’m trying to order a query in the database grouping the information, but this showing the first registered in the database, but I want the last.
SELECT *
FROM base_rating AS B
JOIN historico_rating AS H ON B.id = H.id_base_rating
JOIN escala_rating AS E ON E.id = H.id_rating_atual
WHERE H.titulo!=''
AND E.agencia!=''
GROUP BY B.id_emissao
Which fields do you want to return? Ordered by which field?
– Sorack
If you want to bring the last just, do one
order by coluna DESC limit 1
– R.Santos
I want the last of each group (the most recent of each ) not the last general
– Alex Peçanha