> > On Dec 9, 2009, at 3:42 AM, Wiktor Adamski wrote:
> > 
> > SQLite version 3.6.21
> > Enter ".help" for instructions
> > Enter SQL statements terminated with a ";"
> > sqlite> create table t1(a int);
> > sqlite> create table t2(a int);
> > sqlite> create table t3(a int, b int);
> > sqlite> insert into t1 values(1);
> > sqlite> insert into t3 values(1, 1);
> > sqlite> select * from t1 left join t2 using(a) left join t3
using(a);
> > 1|
> > sqlite> select * from (t1 left join t2 using(a)) left join t3
> > using(a);
> > 1|
> >
> > I think that correct result should be
> > 1|1
> > MySQL and PostgreSQL agree with me.
> 
> Cannot reproduce this problem here:
> 
>    sqlite> d...@computer2:~/work/sqliteG/bld$ ./sqlite3
>    SQLite version 3.6.21
>    Enter ".help" for instructions
>    Enter SQL statements terminated with a ";"
>    sqlite> CREATE TABLE t1(a int);
>    sqlite> CREATE TABLE t2(a int);
>    sqlite> CREATE TABLE t3(a int, b int);
>    sqlite> INSERT INTO t1 VALUES(1);
>    sqlite> INSERT INTO t2 VALUES(1);
>    sqlite> INSERT INTO t3 VALUES(1, 1);
>    sqlite> SELECT * FROM t1 LEFT JOIN t2 USING(a) LEFT JOIN t3
USING(a);
>    1|1
>    sqlite> SELECT * FROM (t1 LEFT JOIN t2 USING(a)) LEFT JOIN t3
> USING(a);
>    1|1
> 
> 
> Dan.
> 

Dan's SQL has an extra insert.

SQLite version 3.6.18
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(a int);
sqlite> create table t2(a int);
sqlite> create table t3(a int, b int);
sqlite> insert into t1 values(1);
sqlite> insert into t3 values(1,1);
sqlite> select * from t1 left join t2 using(a) left join t3 using(a);
1|
sqlite> select * from (t1 left join t2 using(a)) left join t3 using(a);
1|
sqlite> insert into t2 values(1);
sqlite> select * from t1 left join t2 using(a) left join t3 using(a);
1|1
sqlite> select * from (t1 left join t2 using(a)) left join t3 using(a);
1|1
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to