Women in Technology

Hear us Roar



Article:
  What's in a Condition?
Subject:   Pushing the WHERE clause into the FROM clause
Date:   2002-10-07 12:23:49
From:   anonymous2
Although I was already aware of the behaviour being described, I enjoyed this article because it explained it a lot more clearly than I would have managed.


However (just to be picky) pushing the WHERE clause into the FROM statement to me implies structuring this SQL statement:


SELECT c.city_name, c.population, b.business_name
FROM up_city c LEFT OUTER JOIN up_business b
ON c.city_name = b.city_name
WHERE c.population >= 5000;


to something like this:


SELECT c.city_name, c.population, b.business_name
FROM ( select *
from up_city
where c.population >= 5000
) c LEFT OUTER JOIN up_business b
ON c.city_name = b.city_name;


In principle if the SQL is processed according to the conceptual model then the filtering should take place before the join is performed.


Adrian Miley