• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Core Data - Newbie] Predicate Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >[Core Data - Newbie] Predicate Help (From: Charles Haron <email@hidden>)

  • Prev by Date: Cocoa is fun! What am I doing wrong?
  • Next by Date: Deployment build generates editable Applescript file
  • Previous by thread: [Core Data - Newbie] Predicate Help
  • Next by thread: NSNumberFormatter scientific notation
  • Index(es):
    • Date
    • Thread