I have a data frame as
A: V1 V2
1 3
1 4
3 4
1 6
6 5
I want output which satisfies transitive property on V1 and V2
B: V1 V2 V3
1 3 4
I have a data frame as
A: V1 V2
1 3
1 4
3 4
1 6
6 5
I want output which satisfies transitive property on V1 and V2
B: V1 V2 V3
1 3 4
Copyright © 2021 Jogjafile Inc.
The idea is you select one source and try to find the transitivity with two targets. if those are the same then you have the right combination.
I add additional columns for debug purpose, but the query can be simplify a little bit more.
SQL DEMO
OUTPUT
To get the result you want select the right columns and add aditional filter