I have this table below
uid rid time_type date_time
a11 1 2 5/4/2013 00:32:00 (row1)
a43 1 1 5/4/2013 00:32:01 (row2)
a68 1 1 5/4/2013 00:32:02 (row3)
a98 1 2 5/4/2013 00:32:03 (row4)
a45 1 2 5/4/2013 00:32:04 (row5)
a94 1 1 5/4/2013 00:32:05 (row6)
a35 1 2 5/4/2013 00:32:07 (row7)
a33 1 2 5/4/2013 00:32:08 (row8)
Can I use a normal select query to extract the data such that it becomes
uid rid time_type date_time
a43 1 1 5/4/2013 00:32:01 (row2)
a98 1 2 5/4/2013 00:32:03 (row4)
a94 1 1 5/4/2013 00:32:05 (row6)
a35 1 2 5/4/2013 00:32:07 (row7)
The date_time field is in asc order. logic is that time_type '1' needs to be paired with the next time_type '2' of the same rid. If time_type '1' or '2' appears in a group of 2 or more ordered by date_time, I will take the earlier one and ignore the rest.
Can this be done?