Re: [SQLObject] left join with subquery and WHERE
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2010-05-14 15:21:12
|
On Fri, May 14, 2010 at 04:43:46PM +0200, Imre Horvath wrote: > sqlite> select * from pricegroups > ...> left join (select * from products_pricegroups > ...> where products_pricegroups.product_id=1) as a > ...> on (pricegroups.id=a.pricegroup_id); I don't understan what is aliased as 'a'. The subquery? I tried to take it into parentheses: select * from pricegroups left join ((select * from products_pricegroups where products_pricegroups.product_id=1) as a) on (pricegroups.id=a.pricegroup_id); bug got an error: SQL error near line 1: no such column: a.pricegroup_id. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |