Page 1 of 1

[SQL] JOINing 2 row sets

Posted: Fri Jan 18, 2019 8:49 pm
by Villeroy
Original topic: viewtopic.php?f=13&t=96607&p=462482#p462482

What does the JOIN keyword do with 2 tables?
Why are there so many variants of JOIN in the literature on SQL? Well, many of them are equivalent to each other.
How is it related to the Cartesian Product of the 2 tables?
Is there any difference between the inner join and the selection from 2 tables where A.X=B.Y? Answer: Some old fashioned database engines work more efficiently with JOINs. In HSQL they are equivalent.

Re: [SQL] JOINing 2 row sets

Posted: Sat Jan 26, 2019 12:18 am
by UnklDonald418
Thanks for the useful examples, but I did notice a problem. Most of your queries contain inline comments that are preceded by //. That works fine in the Direct SQL mode, but most visitors will attempt to run them in the default mode and the Base parser will raise a Syntax error. Apparently the parser only allows comments to be preceded by --.

Re: [SQL] JOINing 2 row sets

Posted: Wed Sep 18, 2019 12:58 pm
by Villeroy
Thank you for the hint. I made this with LibreOffice which ignores the comments. I did not know that Openoffice refuses to run queries with inline comments. So I replaced it with another version without inline comments and added the documentation to the readme form.