1 A, B 2 B A 3 C D 4 D C each great spirit: How to get the final result 1-3 or 1-4 or 2-3 or 2-4 data, the rule is about the value of the left and right not equal? [/size]
CodePudding user response:
Select id, colA, colB The from mytable t Where the exists (select 1 from mytable where greatest (tc olA, tc olB)=colA and further (tc olA, tc olB)=colB)
- two years before had this problem, try this statement, there is a problem ask again,