Folks,

I could do with some decent docs on subqueries. I've tried to play
with what's on the website, but it's not helping me to convert the
following into an SQLAlchemy subquery:

select * from symbollistentries WHERE
symbollistentries.symbollistentry_id NOT IN (select
symbollistentries.symbollistentry_id from symbollistentries join votes
ON (votes.symbollistentry_id=symbollistentries.symbollistentry_id)
join states ON (states.state_id=votes.state_id) join users ON
(users.user_id=states.owner_id) WHERE users.user_name='admin');

It doesn't really matter what I'm doing here, this is just an example,
and I've all kinds of mappers in place that I use for queries. What I
really need is a pointer to some good subquery examples, not the
solution to encoding the above. I need to understand how aliases work
and how I can, for example, perform the nested select, alias it and
then test for "NOT IN" using another query. I can't see how you
implement "NOT IN" either :)

TIA,

Jon.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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