Using A Self Join - SQLZOO
Using A Self Join - SQLZOO
Contents
Edinburgh Buses: self join
Examples of self joins on the route table
Self join of route on (num, company)
Self join of route on stop
https://sqlzoo.net/wiki/Using_a_self_join 1/2
12/26/21, 9:58 PM Using a self join - SQLZOO
...
We might join the route table with itself on the stop field.
The result is a list of all pairs of services which
share a
stop.
WHERE R1.stop=R2.stop;
https://sqlzoo.net/wiki/Using_a_self_join 2/2