Re: [sqlite] Table-Alias Confusion or Bug?
At 17:33 27.05.2009, D. Richard Hipp wrote: >On May 27, 2009, at 11:26 AM, Ralf Junker wrote: > >> Hello! >> >> Given this SQL: >> >> drop table if exists t; >> >> create table t (c); >> >> select * >>from t as ta >>where t.c = ta.c; >> >> SQLite3 chokes with the following error: >> >> SQL error near line 5: no such column: t.c >> >> Question: >> >> Is this the expected behaviour? I know that the where clause does >> not make sense, but shouldn't SQLite see both "t.c" and "ta.c" as >> the same columns instead of reporting the error? > >This is the behavior that I expected because I deliberately coded it >that way. Once you us an AS clause, the table is thereafter known >only by its AS name, not its original name. Thanks for the clarification! Ralf ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Table-Alias Confusion or Bug?
On May 27, 2009, at 11:26 AM, Ralf Junker wrote: > Hello! > > Given this SQL: > > drop table if exists t; > > create table t (c); > > select * >from t as ta >where t.c = ta.c; > > SQLite3 chokes with the following error: > > SQL error near line 5: no such column: t.c > > Question: > > Is this the expected behaviour? I know that the where clause does > not make sense, but shouldn't SQLite see both "t.c" and "ta.c" as > the same columns instead of reporting the error? This is the behavior that I expected because I deliberately coded it that way. Once you us an AS clause, the table is thereafter known only by its AS name, not its original name. D. Richard Hipp d...@hwaci.com ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Table-Alias Confusion or Bug?
Hello! Given this SQL: drop table if exists t; create table t (c); select * from t as ta where t.c = ta.c; SQLite3 chokes with the following error: SQL error near line 5: no such column: t.c Question: Is this the expected behaviour? I know that the where clause does not make sense, but shouldn't SQLite see both "t.c" and "ta.c" as the same columns instead of reporting the error? Thanks for any response, Ralf ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users