Basic syntax question on qualified table names in a select. I've got 2 attached 
databases, say db1 and db2, and I try to run...

insert into main.foo
select db1.foo.*
from db1.foo left outer join db2.bar
on db1.foo.pk = db2.bar.pk
where db2.bar.pk is null;

and I get "Error: near "*": syntax error"

If I give db1.foo an alias though it treats it as fine.

insert into main.foo
select aliasName.*
from db1.foo as aliasName left outer join db2.bar
on aliasName.pk = db2.bar.pk
where db2.bar.pk is null;

Following the nice SQL diagrams it looks like in a select you can only have * 
or table-name.*, whereas in other places you can have schema-name.table-name. 
Granted, the second version can be made prettier and more readable, but I would 
have assumed the first version would be ok. Is this par for all SQL versions?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to