我该如何将以下的mysql查询语句转换为SQLAlchemy代码?
SELECT * FROM `table_a` ta, `table_b` tb where 1
AND ta.id = tb.id
AND ta.id not in (select id from `table_c`)
到目前为止,我在使用SQLAlchemy方面的内容如下:
query = session.query(table_a, table_b)
query = query.filter(table_a.id == table_b.id)
notin_([42, 43, 44, 45])
。 - tandynot_in()
。https://docs.sqlalchemy.org/en/14/core/sqlelement.html#sqlalchemy.sql.expression.ColumnOperators.not_in - user1023102notin_()
可以使用了! - Jonnathan Carrasco