Using sqlalchemy to query using multiple column where in clause

Posted by crunkchitis on Stack Overflow See other posts from Stack Overflow or by crunkchitis
Published on 2014-08-21T22:18:53Z Indexed on 2014/08/21 22:19 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

I'm looking to execute this query using sqlalchemy.

SELECT name,
       age,
       favorite_color,
       favorite_food
FROM kindergarten_classroom
WHERE (favorite_color,
       favorite_food) IN (('lavender','lentil soup'),('black','carrot juice'));

I only want kids that like (lavender AND lentil soup) OR (black and carrot juice).

This is similar, but doesn't get me all of the way there: Sqlalchemy in clause

© Stack Overflow or respective owner

Related posts about python

Related posts about mysql