Michael Bayer wrote:
> for now I would recommend experimenting with the underlyting selectable
> object used by a union so you can get a feel for it (we can then add on
> intersect() and except_clause() methods at some point)
>
> from sqlalchemy.sql import CompoundSelect
>
> a = mytable.select()
> b = select(<someotherstuff>)
> c = ....
>
> q = CompoundSelect('UNION', a, b)
> x = CompoundSelect('INTERSECT', q, c)
> y = CompoundSelect('EXCEPT', x, d, g, h, i)
>
> y.execute()
Oooh... sweet!
I'd missed CompoundSelect when glancing through the docs. Thank you very
kindly for the pointer.
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users