MYSQL distinct query
- by Patrick
This is my example of my table:
id | name | foreign_id |
1 a 100
2 b 100
3 c 100
4 a 101
5 b 101
6 c 101
I would like to get the distinct file with the latest foreign_id (bigger number).
In this example, it would be row with id 4,5,6. Anyone has any idea? Thank you very much!