in fact all the problem is that I can't generate the following query:

SELECT xx.yy, (SELECT xx.yy WHERE cond) FROM foobar xx;

where xx.yy are the same columns

SQLAlchemy generates :

SELECT xx.yy, (SELECT xx.yy FROM foobar xx WHERE cond) FROM foobar xx;

On Fri, 2008-03-28 at 18:16 +0100, Julien wrote:
> In the documentation I found 
> 
> "Note that "from" objects are automatically located within the columns
> and whereclause ClauseElements"
> 
> for the select() statement.
> 
> It is precisely the thing I do not want to.. no way to disable it .. ?
> 
> Thanks,
> Julien
> 
> 
> On Fri, 2008-03-28 at 09:30 -0400, Michael Bayer wrote:
> > 
> > On Mar 28, 2008, at 8:06 AM, Julien wrote:
> > 
> > >
> > >            ##### Problem is here #####
> > >            func.count(
> > >                select(
> > >                    [sp.c.id],
> > >                    sp.c.site_id.in_(
> > >                        select(
> > >                            [model.t_sites.c.id],
> > >                            and_(
> > >                                model.t_sites.c.latitude != None,
> > >                                model.t_sites.c.longitude != None,
> > >                            )
> > >                        )
> > >                    )
> > >                )
> > >            ).label('specimen_filtered_georeferenced'),
> > >            ##############################
> > >
> > 
> > 
> > I think you want to convert the select to a scalar, i.e.  
> > count(myselect.as_scalar()).
> > 
> > 
> > > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to