Sql Select Multiple Conditions In Python