Skip to content
Advertisement

SQL Query for the player and vsplayer [closed]

Team Table

Expected Output: with Two columns

How to write a sql query to get the exact output as Expected output mentioned above. Thanks in advance

Advertisement

Answer

The normal way to get combination (pairs) is to take all permutations, but where column 1 is less than column 2.

Demo : https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=9ce7af3d0afe89c6434cc2800dfbd2ef

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement