> You have three distinct columns here - t1.a, t2.a and t3.a. With left joins, > it's possible for some but not all of them to be null, so it matters which > one you select. > > Even with inner joins, it may matter which column you pick. E.g., in SQLite > it's possible that a=b but typeof(a) != typeof(b)
I believe OP's point here (which I can agree with) is when he executes "select * ..." he gets only one column (which one is it btw?). So it's quite reasonable to assume that if he puts the name of this column instead of asterisk he should get the same result. But he doesn't get it. Pavel On Wed, Dec 23, 2009 at 11:09 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Wiktor Adamski > <bardzotajneko...@interia.pl> wrote: >> There's no reason for following error: >> >> SQLite version 3.6.21 >> Enter ".help" for instructions >> Enter SQL statements terminated with a ";" >> sqlite> .headers ON >> sqlite> create table t1(a int); >> sqlite> create table t2(a int); >> sqlite> create table t3(a int); >> sqlite> insert into t1 values(1); >> sqlite> select * from t1 left join t2 using(a) left join t3 using(a); >> a >> 1 >> sqlite> select a from t1 left join t2 using(a) left join t3 using(a); >> Error: ambiguous column name: a > > You have three distinct columns here - t1.a, t2.a and t3.a. With left joins, > it's possible for some but not all of them to be null, so it matters which > one you select. > > Even with inner joins, it may matter which column you pick. E.g., in SQLite > it's possible that a=b but typeof(a) != typeof(b) > > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users