| Public Scratchpad | Download, Select Code To D/L |
Using proper syntax
Produces DBIC_TRACE of:$result_set->search( {}, { select => [ 'winner', \'COUNT(*) AS votes', ], as => [ 'winner', 'votes', ], group_by => [ 'winner', ], having => { 'votes' => 6 }, } );
Short-circuiting placeholders
DBIC_TRACE shows:$result_set->search( {}, { select => [ 'winner', \'COUNT(*) AS votes', ], as => [ 'winner', 'votes', ], group_by => [ 'winner', ], having => 'votes = 6', } );
First fails to return a valid result, second works fine.