On 7/23/06, blins <[EMAIL PROTECTED]> wrote:
Hi Jay,

Friday, July 21, 2006, 7:05:59 PM, you wrote:

JS> Can you change the alias to a different field name than the source tables?

I try:
   select t1.field1 as otherfield1, t2.field2 as otherfield2 from table1 t1 
left join table2 t2 on
   (t1.id=t2.refid)
and I receive the message on a mistake "no such column: t1.field1(1)"


The alias on the tables seems to be the problem

C:\Temp\convention>sqlite3 test.db
SQLite version 3.0.8
Enter ".help" for instructions
sqlite> create table table1
  ...> (
  ...> id int,
  ...> field1 text
  ...> );
sqlite>
sqlite> create table table2
  ...> (
  ...> refid int,
  ...> field2 text
  ...> );
sqlite> select t1.field1 as otherfield1, t2.field2 as otherfield2
  ...>  from table1 t1
  ...>   left join table2 t2 on table1.id = table2.refid
  ...> ;
SQL error: no such column: table1.id

sqlite> select id from table1;
sqlite> select table1.field1 as otherfield1, table2.field2 as otherfield2
  ...>  from table1
  ...>   left join table2 on table1.id = table2.refid ;
sqlite>



--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

Reply via email to