[sqlalchemy] Re: Query to get all items from a table which have no reference to another table?

2008-08-25 Thread Empty
Hello Felix, No I want to get all items from table A where no matching item in table B exists. I'm aware that this would be very easy if table A stores the foreign key. SQLAlchemy supports the NOT EXISTS syntax through the any() / has() methods. You should be able to do something like this:

[sqlalchemy] Re: Query to get all items from a table which have no reference to another table?

2008-08-25 Thread ml
Hi! Or something like s.query(A).filter(not_(A.column.in_(select(table_b.c.column)) David Empty napsal(a): Hello Felix, No I want to get all items from table A where no matching item in table B exists. I'm aware that this would be very easy if table A stores the foreign key.