From: Jess Robinson Date: Sat, 1 Apr 2006 17:05:24 +0000 (+0000) Subject: added "having" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea1eaf8db1d8ad46a7342e45358f4bcfd293de93;p=dbsrgits%2FDBIx-Class-Historic.git added "having" --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index c012011..857dfca 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -491,6 +491,10 @@ Can be used to efficiently iterate over records in the resultset: print $cd->title; } +Note that you need to store the resultset object, and call C on it. +Calling C<< resultset('Table')->next >> repeatedly will always return the +first record from the resultset. + =cut sub next { @@ -1581,6 +1585,20 @@ A arrayref of columns to group by. Can include columns of joined tables. group_by => [qw/ column1 column2 ... /] +=head2 having + +=over 4 + +=item Value: $condition + +=back + +HAVING is a select statement attribute that is applied between GROUP BY and +ORDER BY. It is applied to the after the grouping calculations have been +done. + + having => { 'count(employee)' => { '>=', 100 } } + =head2 distinct =over 4