I want to query the jump table for the value of the aID column, which matches all the values ββof the identifier list ids=[3,5] in the bID column.
This is my connection table ( JT ):
aID bID 1 1 1 2 2 5 2 3 1 3 3 5
I have this query: session.query(JT.aID).filter(JT.bID.in_(ids)).all()
This query returns aID 1 , 2 and 3 because they all have rows with 3 or 5 in the bID column. I want to return query 2 because this is the only aID value that has all the values ββin the ids list in the bID column.
I donβt know how to better explain the problem, but how can I get the result?
boadescriptor
source share