Itβs not entirely clear to me from your layout whether the date and time are shown in separate columns or only one. That is, you have
ID theDate theTime -- -------- ------- 1 09/05/02 6:00 1 09/05/02 8:00 2 09/05/03 6:00 3 09/05/04 8:00 4 09/05/04 6:00
or
ID theDateTime -- ------------- 1 09/05/02 6:00 1 09/05/02 8:00 2 09/05/03 6:00 3 09/05/04 8:00 4 09/05/04 6:00
If the first is true, as it seems, then Ramesh has an almost, but not quite correct answer:
select * from theTable where theDate in ( select theDate from theTable group by theDate having count(theDate) % 2 = 0 )
If the second is true, your work is much more complicated - I will think about it.
source share