I have a table which looks like the following:
| ID | Person | Modified On |
If I have the following records:
{id: 1, person: 'John', Modified On: 2014-06-01 12:00:00},
{id: 2, person 'John', Modified On: 2014-06-02 12:00:00},
{id: 2, person 'Kate', Modified On: 2014-06-02 12:08:00},
{id: 2, person 'Sarah', Modified On: 2014-06-02 12:02:00},
{id: 2, person 'Sarah', Modified On: 2014-06-01 12:00:00}
Notice that the same person "John" and Sarah is in there twice. Modified once on June 1, and again on June 2.
What I'd like is to be able to select one of each person, but only their earliest dates. So my results should be:
{id: 1, person: 'John', Modified On: 2014-06-01 12:00:00},
{id: 2, person 'Kate', Modified On: 2014-06-02 12:08:00},
{id: 2, person 'Sarah', Modified On: 2014-06-01 12:00:00}
How should I construct my SQL to do so?