I have a table like
___________
| id | date |
-----------
with values like
1, 2012-02-21 04:04:04
2, 2012-02-21 05:03:05
3, 2012-02-22 03:03:03
Now, ask is to have a query which fetches 1 id/day which is corresponding to lower date
so, in this case query should return
id
---
1
3
// for date=2012-02-21, there are 2 rows, so row with id 1 is selected due to lower date value
// for date=2012-02-22, there is only 1 row, so corresponding id is picked
(Sorry for not a descriptive title)
You could try this: