Re: WO way to SELECT MAX(FOO) FROM BAR
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