I have this relationship:
player <—>> games <<—> quiz
and want to get all quiz not in a game of a player, like
SELECT *
FROM ZQUIZ
WHERE Z_PK NOT IN (SELECT ZQUIZ
FROM ZGAME
WHERE ZPLAYER == 1)
Can anybody help?
This can be done with a SUBQUERY clause. If myPlayer
is the player in question:
let predicate = NSPredicate(format:"SUBQUERY(games,$g, $g.player == %@).@count == 0", myPlayer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With