Re: [pysqlite] Error when using table alias
mercado <[email protected]> Wed, 18 Mar 2009 00:21:47 -0400
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
--===============1901712551==
Content-Type: multipart/alternative; boundary=0016e6470b68a291f204655d05ab
--0016e6470b68a291f204655d05ab
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I did some more tests, and I've been able to narrow things down a bit more.
It seems that the problem comes when I do a join against a derived table and
the column used in the join condition is prefaced by a table alias inside
the derived table.
For example, the following query works fine:
--------------------------------------------------------------------------------
select b.bookmark_id
from bookmark b
inner join (
select bookmark_id from bookmark z
) as agg
on b.bookmark_id = agg.bookmark_id
--------------------------------------------------------------------------------
But this one throws the pysqlite2.dbapi2.OperationalError error:
--------------------------------------------------------------------------------
select b.bookmark_id
from bookmark b
inner join (
select z.bookmark_id from bookmark z
) as agg
on b.bookmark_id = agg.bookmark_id
--------------------------------------------------------------------------------
Any ideas?
--0016e6470b68a291f204655d05ab
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I did some more tests, and I've been able to narrow things down a bit m=
ore.=A0 It seems that the problem comes when I do a join against a derived =
table and the column used in the join condition is prefaced by a table alia=
s inside the derived table.<br>
<br>For example, the following query works fine:<br>-----------------------=
---------------------------------------------------------<br>select b.bookm=
ark_id <br>from bookmark b<br>inner join (<br>=A0=A0=A0 select bookmark_id =
from bookmark z<br>
) as agg<br>=A0=A0=A0 on b.bookmark_id =3D agg.bookmark_id<br>-------------=
-------------------------------------------------------------------<br><br>=
But this one throws the pysqlite2.dbapi2.OperationalError error:<br>-------=
-------------------------------------------------------------------------<b=
r>
select b.bookmark_id <br>from bookmark b<br>inner join (<br>=A0=A0=A0 selec=
t z.bookmark_id from bookmark z<br>) as agg<br>=A0=A0=A0 on b.bookmark_id =
=3D agg.bookmark_id<br>----------------------------------------------------=
----------------------------<br>
<br>Any ideas?<br>
--0016e6470b68a291f204655d05ab--
--===============1901712551==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
list-pysqlite mailing list
list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org
http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite
--===============1901712551==--