SQL, problem with OrderBy / GroupBy
- by Tristan
Hi,
In my table I have two fields among others : article_id and *version*
*example:
article_id : 5 // version 1
aricle_id: 5 // version 2
article_id: 6 // version 1*
What i want to do is to retrieve the latest version for each article id (in my example i want to retrieve the article 5 version 2 object and article 6 and version 1 object).
The problem is that mysql is doing the groupBy instead of the OrderBy so it returns to me the FIRST version of each article, but i want the opposit.
Do you have an idea please ?