With the data you provided, your request is not possible. The data on lines 5 and 6 do not differ from each other.
Assuming your table is called "quux" if you start with something like this:
SELECT a.COL1, a.COL2, a.COL3 FROM quux a, quux b WHERE a.COL1 = b.COL1 AND a.COL2 = b.COL2 AND a.COL3 <> b.COL3 ORDER BY a.COL1, a.COL2
As a result, you will get the answer:
COL1 COL2 COL3 --------------------- aa 111 blah_x aa 111 blah_j
This is because lines 5 and 6 have the same values ββfor COL3. Any query that returns both rows 5 and 6 also returns duplicates of ALL rows in this dataset.
On the other hand, if you have a primary key (ID), you can use this query instead:
SELECT a.COL1, a.COL2, a.COL3 FROM quux a, quux b WHERE a.COL1 = b.COL1 AND a.COL2 = b.COL2 AND a.ID <> b.ID ORDER BY a.COL1, a.COL2
[Edited to simplify the WHERE clause]
And you will get the desired results:
COL1 COL2 COL3 --------------------- aa 111 blah_x aa 111 blah_j bb 112 blah_d bb 112 blah_d
I just tested this on SQL Server 2000, but you should see the same results in any modern SQL database.
blorgbeard proved me wrong - good for him!