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

WO way to SELECT MAX(FOO) FROM BAR


  • Subject: WO way to SELECT MAX(FOO) FROM BAR
  • From: David Avendasora <email@hidden>
  • Date: Thu, 11 Dec 2008 15:44:30 -0500

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


  • Follow-Ups:
    • Re: WO way to SELECT MAX(FOO) FROM BAR
      • From: Houdah - ML Pierre Bernard <email@hidden>
    • Re: WO way to SELECT MAX(FOO) FROM BAR
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: ERPrototypes + intBoolean + INTEGER + boolean qualifier = fail
  • Next by Date: Distinct set of objects?
  • Previous by thread: Re: New WOLips - bug when building wonder frameworks
  • Next by thread: Re: WO way to SELECT MAX(FOO) FROM BAR
  • Index(es):
    • Date
    • Thread