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