[LEFT JOIN behaviour] Re: Question about bug 73953

From: Luuk <luuk_at_invalid.lan>
Date: Sat, 11 Oct 2014 10:59:50 +0200
Message-ID: <5438f185$0$2904$e4fe514c_at_news.xs4all.nl>


On 11-10-2014 01:54, Jerry Stuckle wrote:

> That's what I'm not sure of. The query "select a.id from a left join
> b_view on b_view.a_id = a.id WHERE b_view.is_x = 1;" is a LEFT JOIN with
> no filter criteria n 'a', all rows of 'a' should be returned. That's
> what a LEFT JOIN does.
>

But a query should also limit the returned rows to what is stated in the WHERE-clause.

This should return all rows from `a`:
select a.id from a
left join b_view on b_view.a_id = a.id

But this should NOT do so:
select a.id from a
left join b_view on b_view.a_id = a.id
where 1=0 Received on Sat Oct 11 2014 - 10:59:50 CEST

Original text of this message