[Zope] ZSQL subselect P

Jim Penny jpenny@universal-fasteners.com
Tue, 13 Mar 2001 17:44:49 -0500


On Tue, Mar 13, 2001 at 03:14:00PM -0700, Casey Duncan wrote:
> Lee Marzke wrote:
> > 
> > Hi,
> > 
> > I'm trying to use a subquery with the following SQL syntax and get an error.
> > 
> > SELECT * from return WHERE requestid = ( SELECT requestid from return ORDER BY
> > requestid LIMIT 1 )
> > 
> > Each part of the queary works seperatly but not together.  Are their limitation
> > on SQL statements that are allowed ?
> > 
> > Using Zope 2.3.0 and
> > PostgresSQL 7.0.3
> > ZPoPyDA-1.2.tar.gz
> > PoPy-2.0.2.tar.gz
> > 

I guarantee that (some) subselects can be done with this combo of software,
use them all the time.  I am a bit concerned about the LIMIT clause in
a subselect.

Would it not be far easier to say

SELECT * FROM return WHERE requestid = ( SELECT min(requestid) FROM return)
?


Jim

> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>