Hi
Here is example:of my question.
id-----date------ number
1 2012-05-01 100
2 2012-05-01 101
3 2012-05-01 102
4 2012-05-02 103
5 2012-05-03 104
6 2012-05-04 105
7 2012-05-04 101
8 2012-05-04 102
9 2012-05-05 106
First, I want to select all records <= 2012-05-03
So, the result will look like below:
id------date------ number
1 2012-05-01 100
2 2012-05-01 101
3 2012-05-01 102
4 2012-05-02 103
5 2012-05-03 104
But, now, i also want to include the records below. Because the number 101 and 102 also exist in the query above.
id------date------ number
7 2012-05-04 101
8 2012-05-04 102
So, The final result that i want is:
id------date------ number
1 2012-05-01 100
2 2012-05-01 101
3 2012-05-01 102
4 2012-05-02 103
5 2012-05-03 104
7 2012-05-04 101
8 2012-05-04 102
Could anyone please help how to write the sql query? There are about 100 thousand records in the database table.
Hope you guys understand what i means, thanks in advance.