Home > database >  Oracle to heavy operation
Oracle to heavy operation

Time:09-25

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,

CodePudding user response:

reference 1st floor wmxcn2000 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 to cross-examine,

CodePudding user response:

refer to the second floor baidu_36457652 response:
Quote: refer to 1st floor wmxcn2000 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 to cross-examine,

  • Related