Reputation: 41
How can I check if the condition value is between column1 and column2?
MySQL:
select
*
from
tablename
where
'2014-01-01' between start_date and end_date
SQLAlchemy:
select(
[table.c.id],
and_('2014-01-01'.between(start_date, end_date))
)
is it possible ?
Upvotes: 2
Views: 588
Reputation: 75207
from sqlalchemy import literal
literal('2014-01-01').between(x, y)
Upvotes: 3