I believe a comma is basically an inner join with no ON clause.

I think this covers it
https://www.sqlite.org/lang_select.html#fromclause
"If the join-operator is "CROSS JOIN", "INNER JOIN", "JOIN" or a comma (",") 
and there is no ON or USING clause, then the result of the join is simply the 
cartesian product of the left and right-hand datasets."

So it's basically a personal preference. Similar to how it's been noted that 
for inner joins, putting the constraint in the ON clause or there WHERE clause 
results in the same meaning.


(For my personal preference the comma thing is one of those things that drives 
me completely batty every time I see it. But that's just the way my brain works 
when reading or creating a query)


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Dominique Devienne
Sent: Wednesday, February 27, 2019 9:06 AM
To: SQLite mailing list
Subject: Re: [sqlite] Getting data from two JOIN tables

On Wed, Feb 27, 2019 at 2:18 PM Jose Isaias Cabrera <jic...@outlook.com>
wrote:

> Thanks.  This is exactly what I needed.  So, there is really no JOIN here,
> or is the "from t outer_t, z outer_z" a JOIN like statement?  Where can I
> read more about this?  And yes, your assessment of t(a, idate) and z(f,
> idate) being unique are true.
>

Yes there is:

select ...
>   from t outer_t, z outer_z
>  where a == f
>    and a == 'p001'
>    and ...
>

That's equivalent to
select ...
  from t outer_t
  join z outer_z on t.a = z.f

With additional where clauses involving correlated subqueries to determine
the max(idate) on both sides, given a given a value (and thus f value too,
given the join condition).

At least that's how I read it. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to