I have a sample table like this:
Code | Time |
---|---|
A | 9:30:06 |
A | 9:30:07 |
A | 10:00:00 |
B | 10:30:00 |
A | 10:45:00 |
B | 10:46:01 |
B | 10:46:00 |
I want:
Code | Time |
---|---|
A | 9:30:06 |
A | 10:00:00 |
B | 10:30:00 |
A | 10:45:00 |
B | 10:46:01 |
The time selected is not important, the GROUP BY
or DISTINCT ON
should be on a range of 1 second.
EDIT: All code
within 1 second of each other are considered duplicate and only one row of them should be selected.