我希望有类似
的条件我理解的文档(http://code.google.com/appengine/docs/python/datastore/queries.html和http://code.google.com/appengine/docs/python/datastore/gqlqueryclass.html)as中确定的两种方式是:
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标识符无效(
OR
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 = end_time_input)
错误:解析错误:在符号< =
处预计没有其他符号请帮忙!
答案 0 :(得分:3)
GQL没有OR。见http://code.google.com/appengine/docs/python/datastore/gqlreference.html
您需要以多个查询的方式执行此操作。