Click to See Complete Forum and Search --> : Which JOIN executes first?


ss1289
06-24-2008, 09:58 AM
SELECT * FROM person
JOIN emailaddress ON person.personid = emailaddress.personid
JOIN package ON package.personid = person.personid

In the execution level, which JOIN is executed first? This is just a basic example but I was wondering how it's executed.

sstalder
06-24-2008, 10:58 AM
The first join is executed first.

chazzy
06-24-2008, 09:07 PM
you can pretty much assume it's top-down execution, since a query like this will fail:


select
cols...
from tablea
join tableb on tablec.colA = tableb.colA
join tablec on tablea.colB = tablec.colB


but there's nothing in the standard (from what I remember) requiring this.