It may not be the level of database independence that ERXEOControlUtilities offers, but if your dealing with SQL for the foreseeable future it should be pretty safe to do something like:
EOUtilities.rawRowsForSQL(ERXEC.newEditingContext(), "MyModelName", "SELECT COUNT(somefield), SUM(somefield) FROM sometable WHERE somefield IS NOT NULL" , new String[] {"count", "sum"}) ;
Of course I have no idea what the specifics of your query dictate and this may be too simple to achieve your goal, but if you have a clear idea of the sql that you need, you may be able to see how a structure of qualifiers can be arranged to satisfy your need.
On Apr 12, 2012, at 4:38 AM, Ron X wrote: but how can i do COUNT() and SUM() in ONE query?
aggregateFunctionWithQualifier - name of the function - just one (count/sum), but i need two (count & sum)
11 апреля 2012 г. 19:17 пользователь Ramsey Gurley <email@hidden> написал:
ERXEOControlUtilities.aggregateFunctionWithQualifier
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: | |
| >SQL (From: Ron X <email@hidden>) |
| >Re: SQL (From: David LeBer <email@hidden>) |
| >Re: SQL (From: Ron X <email@hidden>) |
| >Re: SQL (From: Ramsey Gurley <email@hidden>) |
| >Re: SQL (From: Ron X <email@hidden>) |
|