I have this table below
uid rid time_type date_time
a11 1 1 5/4/2013 00:32:00 (row1)
a43 2 1 5/4/2013 00:32:01 (row2)
a68 2 2 5/4/2013 00:32:02 (row3)
a98 2 1 5/4/2013 00:32:03 (row4)
a45 2 1 5/4/2013 00:32:04 (row5)
a94 1 2 5/4/2013 00:32:05 (row6)
a35 2 2 5/4/2013 00:32:07 (row7)
a33 2 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
a11 1 1 5/4/2013 00:32:00 (row1)
a94 1 2 5/4/2013 00:32:05 (row6)
a43 2 1 5/4/2013 00:32:01 (row2)
a68 2 2 5/4/2013 00:32:02 (row3)
a98 2 1 5/4/2013 00:32:03 (row4)
a35 2 2 5/4/2013 00:32:07 (row7)
a45 2 1 5/4/2013 00:32:04 (row5)
a33 2 2 5/4/2013 00:32:08 (row8)
The logic is that time_type of 1 needs to be paired with the next corresponding time_type 2 for the same rid. Can this be done?