Re: Re[2]: [sqlite] Help me in SQL

2006-07-24 Thread Jay Sprenkle

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


Re[2]: [sqlite] Help me in SQL

2006-07-23 Thread blins
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)"

JS> On 7/20/06, blins <[EMAIL PROTECTED]> wrote:
>> Hi sqlite-users@sqlite.org,
>>
>> I use sqliteODBC 0.68 + ADO and SQLite 3.3.6.
>> I try executing sql:
>>   select t1.field1 as field1, t2.field2 as field2 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)"


-- 
? "? ? ??? ?? ?"
Ñ íàèëó÷øèìè ïîæåëàíèÿìè,
 blinsmailto:[EMAIL PROTECTED]



Re: [sqlite] Help me in SQL

2006-07-21 Thread Jay Sprenkle

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

On 7/20/06, blins <[EMAIL PROTECTED]> wrote:

Hi sqlite-users@sqlite.org,

I use sqliteODBC 0.68 + ADO and SQLite 3.3.6.
I try executing sql:
  select t1.field1 as field1, t2.field2 as field2 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)"


[sqlite] Help me in SQL

2006-07-20 Thread blins
Hi sqlite-users@sqlite.org,

I use sqliteODBC 0.68 + ADO and SQLite 3.3.6.
I try executing sql:
  select t1.field1 as field1, t2.field2 as field2 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)"

--
Компьютеры помогают быстро и эффективно решать проблемы, появившиеся с 
изобретением компьютеров 
С наилучшими пожеланиями,
 blins  mailto:[EMAIL PROTECTED]