Ok so I understand now that this is a limitation in SQL, and that I cannot use the result of a subquery in the from clause within my where cause.
I believe I am supposed to wrap the whole query inside another query and put the where clause on the outer query, would this be correct? I have tried messing around with this a little but haven't managed to get it to work yet. If somebody could just tell me that I'm on the right track, that would be great. Thanks On Jul 16, 2:36 am, "Michael Bayer" <mike...@zzzcomputing.com> wrote: > what is the SQL you would like emitted ? that is always the place to start. > > > > > > The Devil's Programmer wrote: > > > I am currently performing a query with a joined subquery that gets the > > sum of votes on an article. The problem is that when I try to filter > > based on the result of that subquery, i get errors. > > > Code outlining problem (very simple) -http://pastebin.com/m48905db6 > > > Please tell me I don't have to perform the subquery twice :) [once in > > the FROM, once in the WHERE] > > > Thanks --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---