Have a table, and need to output only certain rows. Here is the example:
Table:
ID Pacct Sacct
----------------------
10 12 12
9 13 12
12 14 12
4 15 16
5 16 15
6 17 18
7 19 18
Need to select rows where Pacct <> Sacct whenever there also exists rows where Pacct = Sacct
So, for the table above, the output I am looking for will be:
ID PAcct Sacct
--------------------------
9 13 12
12 14 12
Any ideas on how to accomplish? Thanks a lot!