Hello all,

The schemas generated by the last two joins below are not what I was
expecting.  Could someone point me to documentation on how the schema
generation works when using a subselect in a join?  This was tested on
3.7.17, 3.9.2, and 3.11.0, and the behavior is consistent across these
three sqlite versions.


CREATE TABLE C(A);
CREATE TABLE D(A);

CREATE TABLE join_two_tables AS SELECT C.A FROM C INNER JOIN D ON D.A=C.A;
.schema join_two_tables

CREATE VIEW G AS SELECT * FROM D;

CREATE TABLE join_table_with_view AS SELECT C.A FROM C INNER JOIN G ON
G.A=C.A;
.schema join_table_with_view

CREATE TABLE join_table_with_subselect AS SELECT C.A FROM C INNER JOIN
(SELECT * FROM D) D ON D.A=C.A;
.schema join_table_with_subselect


Output:


CREATE TABLE join_two_tables(A);
CREATE TABLE join_table_with_view("C.A");
CREATE TABLE join_table_with_subselect("C.A");


Best regards,
John Hinrichsen

-- 

This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee, you should not 
disseminate, distribute, alter or copy this e-mail. Please notify the 
sender immediately by e-mail if you have received this e-mail by mistake 
and delete this e-mail from your system. E-mail transmissions cannot be 
guaranteed to be secure or without error as information could be 
intercepted, corrupted, lost, destroyed, or arrive late or incomplete. The 
sender, therefore, does not accept liability for any errors or omissions in 
the contents of this message which arise during or as a result of e-mail 
transmission. If verification is required, please request a hard-copy 
version. This message is provided for information purposes and should not 
be construed as a solicitation or offer to buy or sell any securities or 
related financial instruments in any jurisdiction.

Reply via email to