我想要一个类似的条件
- 开始时间 <= 开始时间输入 <= 结束时间
- 或者
- start_time <= end_time_input <= end_time
- 或者
- (start_time_input <= start_time AND end_time <= end_time_input )
文档中确定的 2 种方式(http://code.google.com/appengine/docs/python/datastore/queries.html和http://code.google.com/appengine/docs/python/datastore/gqlqueryclass .html)据我了解是:
filter_trips = db.GqlQuery("SELECT key FROM Trips WHERE ( start_time <= :start_time_input AND end_time >= :start_time_input ) OR (start_time <= :end_time_input AND end_time >=:end_time_input ) OR ( start_time >= :start_time_input AND end_time <= :end_time_input )" , start_time_input = start_time_input , end_time_input = end_time_input )
错误:解析错误:符号处的 WHERE 标识符无效(
或者
filter_trips = db.GqlQuery("SELECT key FROM Trips WHERE start_time <= :start_time_input <= end_time OR start_time <= :end_time_input <= end_time OR (:start_time_input <= start_time AND end_time <= :end_time_input )" , start_time_input = start_time_input , end_time_input = 结束时间输入)
错误:解析错误:预计符号 <= 处没有其他符号
请帮忙!