I have a Table with columns Date and Number, like so:
date Number 1-1-2012 1 1-2-2012 1 1-3-2012 2 1-4-2012 1
I want to make a sql query that groups the rows with the same Number and take the minimum date. The grouping only may occur when the value iof Number is the same as previous / next row. So the rsult is
date Number 1-1-2012 1 1-3-2012 2 1-4-2012 1
try this:
SQL fiddle demo