I'm currently creating a Java / Mysql Desktop program. When inserting in the database, the table is very simple:
id - dataInserido - códigoProduto - qtd
I would like, by means of a SQL, to group the last records entered on the same date in descending order. Example: I have attached product dock
id - data - produto - qtd
1 - 20/05/2017 - 10001 - 100
1 - 24/05/2017 - 10002 - 10
1 - 27/05/2017 - 100010 - 30
1 - 29/05/2017 - 100020 - 60
1 - 29/05/2017 - 100060 - 70
1 - 29/05/2017 - 100010 - 100
How to group the last (05/29/2017), being 100020, 100060 and 100010, since I have to mount this table in Java? A kind of filter requested by the user.
ps: I do not want to take any date by java, but rather a query by sql itself.