All pastes #589279 Raw Edit

Something

public python v1 · immutable
#589279 ·published 2007-06-25 21:56 UTC
rendered paste body
from sqlalchemy import *from sqlalchemy.sql import _Groupingdb = create_engine('sqlite://')md = BoundMetaData(db.engine)foo = Table('foo',md,Column('id',Integer,primary_key=True))foo.create()for i in range(1,20):    foo.insert().execute(id=i)md.engine.echo=Trueprint list(except_(        select([foo.c.id], foo.c.id.op('%')(2) == 0),        _Grouping(except_(            select([foo.c.id], foo.c.id.op('%')(3) == 0),            select([foo.c.id], foo.c.id.op('%')(4) == 0)        ))).execute())# Expecting 2, 4, 8, 10, 12, 14, 16 - not 2, 10, 14