Forum OpenACS Q&A: Response to Query problem after upgrade of PG and driver.

Collapse
Posted by Tom Jackson on

I'm not sure if this is the issue, but a sub-select referencing an aliased table doesn't seem to work:

acspg3=> select count(*) from ec_orders o
acspg3-> where o.order_id = (select max(order_id) from ec_orders);
 count
-------
     1
(1 row)                                                                                                                    
acspg3=> select count(*) from ec_orders o
acspg3-> where o.order_id = (select max(order_id) from o);
ERROR:  Relation 'o' does not exist