Re: Earliest object in a table
Re: Earliest object in a table
- Subject: Re: Earliest object in a table
- From: shaun <email@hidden>
- Date: Thu, 23 Nov 2006 14:34:19 +1030
Baiss Eric Magnusson wrote:
There must be a few lines, utilizing EOUtilities calls,
that would yield the earliest object, date wise, (there is a stored
NSTimestamp field), from a table "Posts".
Would someone care to share them?
Perhaps something like the following:
String sql =
"select id from post where created_date=
(select min(created_date) from post)";
//whatever the rawrows method is called.
NSArray results = EOUtils.rawRowsForSQL(sql)
NSDictionary row =(NSDictionary)results.objectAtIndex(0);
//whatever the method is called.
Post p = (Post)EOUtils.objectFromRawRow(row);
HTH.
- shaun
_______________________________________________
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