Advertisement
Guest User

Untitled

a guest
Apr 4th, 2013
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT  DISTINCT astops.name, cstops.name FROM
  2.   route a JOIN route b ON a.company=b.company AND a.num = b.num
  3.               JOIN route c ON b.company=c.company AND b.num = c.num AND b.stop = c.stop
  4.               JOIN stops astops ON a.stop = astops.id
  5.               JOIN stops bstops ON b.stop = bstops.id
  6.               JOIN stops cstops ON c.stop = cstops.id
  7. WHERE astops.name = 'Craiglockhart' AND cstops.name = 'Sighthill'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement