Table1
ID fromdate todate
001 23/02/2012 27/02/2012
002 23/02/2012 27/02/2012
003 28/02/2012 09/09/2013
....
Condition: I don't want to show duplicate values, so from date validate with other from date, if it's equal then it should not repeat, to date validate with other to date, if it's equal then to date should not repeat,
Expected Output
ID fromdate todate
001 23/02/2012 27/02/2012
003 28/02/2012 09/09/2013
....
From the above output, 002 is not showing because fromdate and todate is same with 001, so from and to date comparison should not repeat.
How to write a query for the above condition?