如何检查条件值是否在column1和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))
)
有可能吗?
答案 0 :(得分:3)
from sqlalchemy import literal
literal('2014-01-01').between(x, y)