Re: [sqlite] Help with left joins

2017-11-20 Thread x
Sent: Monday, November 20, 2017 3:55:42 PM To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] Help with left joins On 2017/11/20 5:33 PM, x wrote: >> Only if ColB, ColC and ColD are unique in their tables. Otherwise each join >> has the potential of returning multiple row

Re: [sqlite] Help with left joins

2017-11-20 Thread R Smith
On 2017/11/20 5:33 PM, x wrote: Only if ColB, ColC and ColD are unique in their tables. Otherwise each join has the potential of returning multiple rows, which will carry over to the next joins. Thanks David, I did say ColB, ColC & ColD were primary keys. Any kind of Query (especially of

Re: [sqlite] Help with left joins

2017-11-20 Thread x
>Only if ColB, ColC and ColD are unique in their tables. Otherwise each join >has the potential of returning multiple rows, which will carry over to the >next joins. Thanks David, I did say ColB, ColC & ColD were primary keys. ___ sqlite-users mailing

Re: [sqlite] Help with left joins

2017-11-20 Thread David Raymond
, November 20, 2017 8:22 AM To: SQLite mailing list Subject: Re: [sqlite] Help with left joins I’m not sure what you’re saying Simon or maybe you’re not sure what I’m asking. I’m not complaining about the fact SQLite fails to drop what I think is a redundant table in the second explain, I’m merely

Re: [sqlite] Help with left joins

2017-11-20 Thread x
? From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> on behalf of Simon Slavin <slav...@bigfraud.org> Sent: Monday, November 20, 2017 12:34:29 PM To: SQLite mailing list Subject: Re: [sqlite] Help with left joins On 20 Nov 2017, at 11:09a

Re: [sqlite] Help with left joins

2017-11-20 Thread Simon Slavin
On 20 Nov 2017, at 11:09am, x wrote: > explain > select ColA from TblA > left join TblB using (ColB) > left join TblC using (ColC) > left join TblD using (ColD) > where ColBX=?; > > there will be no trace of TblC or TblD as they're redundant. Although you have not

[sqlite] Help with left joins

2017-11-20 Thread x
Suppose TblB has primary key ColB and contains a column ColBX TblC has primary key ColC and contains a column ColCX TblD has primary key ColD and contains a column ColDX TblA has primary key ColA and also contains columns ColB, ColC and ColD (i.e. TblB, TblC and TblD are effectively lookup