I have a table country with single column that has the below values
India
Pakistan
Australia
Srilanka
My result should be like this
India vs Pakistan
India vs Australia
India vs Srilanka
Pakistan vs Srilanka
Pakistan vs Australia
Australia vs Srilanka
How do we achieve this with self join?
Tried with self join but unable to know how to retrieve first value and second value from column
Use the self join with a condition so that a country cannot play against itself:
fiddle
More combinations can be achieved with
<>in the condition:fiddle