This is an archived low-energy page for bots and other anonmyous visitors.
Please sign up if you are a human and want to interact.
in reply to Re: Class::DBI and sql order by in thread Class::DBI and sql order by
I would do something like this:
__PACKAGE__->set_sql(regions_sorted => qq{
SELECT customer.id, customer.name, region.name
FROM customer INNER JOIN region
ON customer.region = region.id
ORDER BY region.name DESC
});
sub retrieve_sorted_by_region
{
my $class = shift;
my $sth = $class->sql_regions_sorted;
$sth->execute
or carp "Error: $DBI::errstr";
return $class->sth_to_objects($sth);
}
$anarion=\$anarion;
s==q^QBY_^=,$_^=$[x7,print
|