Raj
Raj

Reputation: 6015

NSPredicate Format Equivalent to SQL query

I have two tables: table1 and table2. What would be the NSPredicate format equivalent to the following SQL query?

SELECT * FROM table1 where table1.a NOT IN (SELECT table2.b from table2)

Upvotes: 0

Views: 579

Answers (1)

Simon Lee
Simon Lee

Reputation: 22334

Well you can get a list of b values from table2 then do something like this...

[NSPredicate predicateWithFormat:@"NOT (a in %@)", listOfBValues];

Upvotes: 2

Related Questions