I've a table to save some file with a simple versionning system like :
ID | FILENAME | CONTENT | DATE
1 | index.php | Content of index.php v1 | timestamp
2 | main.css| Some CSS content | timestamp
3 | index.php | Content of index.php v2 | timestamp
I need to code a SQL request to find in this table the last inserted content of each file.
For this, I tried to group and order by date but with this request :
SELECT * FROM modeles GROUP BY filename ORDER BY date DESC
but it didn't work because the order is done after the group and because the group take the first entry.
If someone here know the solution (this is probably easy but i don't know how to do...).
Thank you.