With SQLalchemy on postgres, I want to know if one JSON is 'IN' another JSON, which should be in the ON clause of a JOIN, so something like:
SELECT json_1, ... FROM table_1
JOIN
SELECT json_2, ... FROM table_2
ON json_1['b'] IN json_2['b']
Where for example:
json_1 = {"a": ["123"], "b": ["456", "789"]}
json_2 = {"a": ["123"], "b": ["456"]}
So I want to know if json_2['b'] is in json_1['b'] in SQLAlchemy. Not sure of IN can even be used in the ON clause, but maybe a contains or anything else?