Does anyone know what's the DBIx::Class equivalent of an SQL query such as:
SELECT cdr_id,
CASE WHEN service_id = 'GPRS' THEN 'KB' WHEN service_id = 'SMS' THEN 'SMS' END AS unit
FROM ...
Thanks
my $rs = $schema->resultset( 'table' )->
search_rs( {} ,
{ '+columns' => {
unit =>
\do { "CASE WHEN me.service_id='GPRS' THEN 'KB' " .
"WHEN me.service_id='SMS' THEN 'SMS' END" }
} ) ;
Something along this line should work.