Re: [Core Data - Newbie] Predicate Help
Re: [Core Data - Newbie] Predicate Help
- Subject: Re: [Core Data - Newbie] Predicate Help
- From: Charilaos Skiadas <email@hidden>
- Date: Sat, 30 Jul 2005 23:34:33 -0500
On Jul 30, 2005, at 8:52 PM, Charles Haron wrote:
Hello All,
I need to create a predicate that does the equivalent of the
following:
SELECT SUM(itemPrice) FROM InvItems
WHERE inStore = FALSE;
Sorry, not used to this notation, do I understand correctly that what
you want to obtain is the sum of all the values of itemPrice, over
all invItems for which inStore is false?
Then I would do this in two steps:
1) Create a fetch request that returns an array of all invItems where
inStore is false (That's where the predicate comes in, and it would
really be a simple predicate.
2) Ask the array for the value of the keyPath "@sum.itemPrice".
****
InvItems is the entity
itemPrice & inStore are attributes.
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden