hi i have a table like this.
A B
1 2
3 7
6 4
2 1
7 3
8 5
I need the find the row which are like
A B
1 2
2 1
3 7
7 3
ie rows like a=b and b=a
and in that i need any one pair not replica
A B
1 2
3 7
or else
A B
2 1
7 3
regards,
deepa
Printable View
hi i have a table like this.
A B
1 2
3 7
6 4
2 1
7 3
8 5
I need the find the row which are like
A B
1 2
2 1
3 7
7 3
ie rows like a=b and b=a
and in that i need any one pair not replica
A B
1 2
3 7
or else
A B
2 1
7 3
regards,
deepa
Hi!Quote:
Originally posted by sona
I need the find the row which are like
A B
1 2
2 1
3 7
7 3
ie rows like a=b and b=a
Code:select T1.A, T1.B
from T T1, T T2
where T1.A = T2.B
and T1.B = T2.A
For example:Quote:
and in that i need any one pair not replica
A B
1 2
3 7
or else
A B
2 1
7 3
God bless the person who removed the <br> from the code tag!Code:select T1.A, T1.B
from T T1, T T2
where T1.A = T2.B
and T1.B = T2.A
and T1.A < T1.B