I have a table with three columns,
- Id Serial.
- Value real.
- timein Timestamp.
I want to select the values based on a range of days ie. from two days ago until now. The table may contain one or two rows per day, if it does contain two rows, I want to select the second row plus all the rows following it in the period of time.
To clarify:
id | value | timein
1 | 20.5 | 2013-04-25 11:25:42
2 | 4.2 | 2013-04-26 09:10:42
3 | 3.1 | 2013-04-26 15:45:42
4 | 100 | 2013-04-27 14:52:42
5 | 15.5 | 2013-04-28 17:41:42
6 | 23.3 | 2013-04-29 07:32:42
7 | 21.4 | 2013-04-29 14:32:42
If I wanted to select the values from day 26 (only the second row) plus all the values until day 29 and so on, can it be done in one query?