• 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: WO way to SELECT MAX(FOO) FROM BAR
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WO way to SELECT MAX(FOO) FROM BAR


  • Subject: Re: WO way to SELECT MAX(FOO) FROM BAR
  • From: Houdah - ML Pierre Bernard <email@hidden>
  • Date: Sat, 13 Dec 2008 09:57:21 +0100

Use SepcialityFetches from the HoudahEOAccess framework.

On 11 Dec 2008, at 21:44, David Avendasora wrote:

Hi all,

I've googled this, but can't seem to find any answers even though I'm guessing it's a pretty common thing.

I have a table that has nearly 2 million rows and I want to retrieve the maximum value used in the entire table for a given field. The SQL equivelent would be:

SELECT MAX(FIELD) FROM TABLE

Ideally, I'd like the whole row like this would get for me:

SELECT * FROM TABLE
WHERE ID = (SELECT MAX(ID) FROM TABLE)

but I'd be happy just to get the maximum value in that one field.

Should I just do it with straight SQL, or is there a good EOF/Wonder way to do it where I let EOF deal with the DB?

The field is indexed, so the straight SQL call is instantaneous.

Thanks,

Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >WO way to SELECT MAX(FOO) FROM BAR (From: David Avendasora <email@hidden>)

  • Prev by Date: Re: [SOLVED] Re: File upload problem - occasionally nothing happens
  • Next by Date: java.lang.IllegalStateException: Cannot fire array fault with a null handler
  • Previous by thread: Re: WO way to SELECT MAX(FOO) FROM BAR
  • Next by thread: Distinct set of objects?
  • Index(es):
    • Date
    • Thread