Re: [LEFT JOIN behaviour] Re: Question about bug 73953
From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Sat, 11 Oct 2014 10:44:46 -0400
Message-ID: <m1bfot$j7b$2_at_dont-email.me>
>
> 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
>
>
Date: Sat, 11 Oct 2014 10:44:46 -0400
Message-ID: <m1bfot$j7b$2_at_dont-email.me>
On 10/11/2014 4:59 AM, Luuk wrote:
> 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
>
>
True. Easier to look at after a good night's sleep. It's been a loooooong week :)
-- ================== Remove the "x" from my email address Jerry Stuckle jstucklex_at_attglobal.net ==================Received on Sat Oct 11 2014 - 16:44:46 CEST