/suppose that in a Table named Team contains 4 records,
we need to schedule a match between each team vs opposite team:/
India
Pakistan
Srilanka
Australia
OUTPUT
Australia VS India
Australia VS Pakistan
India VS Pakistan
Australia VS Srilanka
Pakistan VS Srilanka
India VS Srilanka
3
Answers
Scheduling matches between 4teams . Using selfjoin joining the table to itself and then using comdition where table a not equal to table b then same team will not be matched to itself it will be filtered and then table a < table match won’t schedule with the same team .
if string in first column is smaller than string in second column then it will return (eg; australia is smaller than india ) compare the first letter of the string .If both starts with same letter then look for the second letter . this is how it works . first execute the query without where condition .You will figure out the concept behind. Thanks