0
I need an sql that, in the table below, always bring the last insert to each user. I tried with distinct but it didn’t work. So in the case below sql would bring the results of row 2 and 5. Detail that there are more columns (city, parents, address, etc...) and that need to appear in the final result.
DATA----------------------ID---NOME
2017-07-17 16:37:38 || 1 || Lucas
2017-07-17 16:38:03 || 1 || Lucas
2017-07-17 16:38:37 || 2 || Juliana
2017-07-17 16:38:47 || 2 || Juliana
2017-07-17 16:39:00 || 2 || Juliana
After all this research, I didn’t find anything. This table will have more inserts with different users (always 1 id for each user) but I only exemplified to understand.
https://forum.imasters.com.br/topic/512214-selecionando-item-max/? do=findComment&comment=2030107 see if it helps
– Motta
Welcome Lucas, for the best benefit of this site start by reading this post https://pt.meta.stackoverflow.com/questions/5483/manual-de-como-n%C3%83o-ask-questions and then also https://pt.meta.stackoverflow.com/questions/5483/manual-de-como-n%C3%83o-ask-questions
– user60252
Sorry any mistake, it was my first question here !
– Lucas