简体   繁体   中英

Parse.com BETWEEN Query

I don't know if Between is the best to use, but even if it is, I don't know how to use it.

I want something like this:

let query = PFQuery(className: "Class")
    query.whereKey("Number1", between: myNumber+2000)

It is incomplete. I want to check numbers on Number1 column and... If myNumber= 3450, I want to retrieve rows where Number1 is between 1450 and 5450

How can I achieve this? Thanks

I think this should do the trick:

let query = PFQuery(className: "Class")
query.whereKey("Number1", greaterThanOrEqualTo: myNumber-2000)
query.whereKey("Number1", lessThanOrEqualTo: myNumber+2000)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM