Hi all:
I'm trying to generate a intersect statement with variable argument 
list, I've tried something like:
    ...
    ltags = ['news', 'publicity']
    s = select([tags.c.channel], tags.c.tag == ltags[0])
    for tag in ltags[1:]:
        s.intersect(select([tags.c.channel], tags.c.tag == tag))

    s1 = select([channels.c.channel], channels.c.channel.in_(s))
    print e.execute(s1).fetchall()

But this give me wrong results... What's the correct way of doing this 
kind of queries?

Thanks.


--

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


Reply via email to