SQL Query to get data from same table different columns
<p>Is there a way to get data from Same table by checking two different columns? Here is the sample wherein i have a table A which has records as shown below</p>

<pre><code>Col.a Col.b Col.c
-----------------
X     Y      Z
Y     X      Z
</code></pre>

<p>There are 3 columns col.a, col.b and col.c and some of them have records as seen below wherein Col.a of one row = col.b of another and vice versa, The only id common among both the rows is col.c... </p>

<p>i want to get list of all distinct col.c ids which exhibit this behaviour.. i tried inner join but was of no help</p>

<p>Please suggest</p>