I have to figure out which swimmers got the same place in the same event. For each pair of such swimmers, i have to display one row showing the event id, the place, and the competitor number of each swimmer involved. example
eventid place competitors tied
SWM012 2 1072528 1099641
SWM021 2 1018529 1061698
This is my code so far
select R1.Eventid, R1.Place, R1.Competitornum, R2.Competitornum
from Results R1, Results R2
where R1.Place = R2.Place
group by R1.Eventid, R1.Place, R1.Competitornum, R2.Competitornum
and this is the output
eventid Place competitornum competitornum
SWM010 1 1121587 1056740
SWM010 1 1121587 1061698
and so on same competitornum for the first column different in the second competitornum column
i just want to know how to get the output like in the above description
First, you likely need to join on the Event ID as well
The above query returns the same results as this
But this will return all unique pairs of ‘ties’. One solution is this
This only works for two-way ties, though.