On May 15, 2007, at 10:57 AM, Michael Reece wrote:
> here
> is what i tried:
>
> my $active = $self->get_groups(
> distinct => 1,
> select => [ 't1.*', 'COUNT(DISTINCT t3.asset_id) as
> temp_asset_count' ],
> multi_many_ok => 1,
> require_objects => ['collections.collection_assets'],
> group_by => 't1.group_id',
> sort_by => 'temp_asset_count DESC',
> );
>
> but the generated query contains "ORDER BY t1.temp_asset_count DESC"
> and i can't seem to get the "t1." not added to the ORDER BY clause.
>
> i know i can resort to get_objects_from_sql, but are there any other
> suggestions?
FYI, experimentation shows that i can get it to not prefix
temp_asset_count with "t1." if i add some extra junk:
sort_by => ['temp_asset_count DESC, "avoid prefixing
temp_asset_count"'],
but, ugh.
this brings up another possibly useful feature, which would allow
something like
discard_columns => ['temp_asset_count']
to keep me from having to set up an accessor for temp_asset_count,
which may never be used outside this sort_by clause.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object