1
我在sqlalchemy中遇到以下奇怪的行爲。SQL鍊金術。查詢中的tuple_ func和None值
Session.query(Player).filter(Player.name == 'Elijah Millsap').filter(Player.birth_date == None).first()
{name: Elijah Millsap, team: []}
Session.query(Player).filter(tuple_(Player.name, Player.birth_date).in_([('Elijah Millsap', None)])).all()
[]
Session.query(Player).filter(tuple_(Player.name, Player.birth_date).in_([('Elijah Millsap', None), ('Chris Bosh', '1984-03-24')])).all()
[{name: Chris Bosh, team: []}]
好像在山坳birth_date爲空失敗使用tuple_