0

Im try to run this query in parse.com, But Everyone not working.

I have 2 tables, One for Promote and second for Archive.

So, I need to fetch all rows in Promote table where is not in archive table.

Like this SELECT * FROM promote WHERE id NOT IN (SELECT promoteID FROM archive WHERE user=userID).

promoteID in archive is Pointer to objectId in Promote Table.

any help Please?

1 Answer 1

1

Try something like this....

PFQuery *innerQuery = [PFQuery queryWithClassName:@"Archive"];
[innerQuery whereKey:@"user" equalTo:[PFUser currentUser]];
[innerQuery orderByDescending:@"createdAt"];

PFQuery *query = [PFQuery queryWithClassName:@"Promote"];
[query whereKey:@"id" doesNotMatchQuery:innerQuery];
[query findObjectsInBackgroundWithBlock:^(NSArray *records, NSError *error) {
    if (error) return;
    for (PFObject *record in records) {
        // .....

       }
}];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.