From: Olaf Alders Date: Tue, 5 Aug 2014 16:25:23 +0000 (-0400) Subject: Reword the having attribute reference X-Git-Tag: v0.082800~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6eed360cc62442088050bea5284ac1853036d447;p=dbsrgits%2FDBIx-Class.git Reword the having attribute reference --- diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 05f2f49..4d4edda 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -480,6 +480,8 @@ nuba: Nuba Princigalli Numa: Dan Sully +oalders: Olaf Alders + ovid: Curtis "Ovid" Poe oyse: Eystein Torget diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index d15696d..18cc57d 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -4546,15 +4546,20 @@ A arrayref of columns to group by. Can include columns of joined tables. =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. +The HAVING operator specifies a B condition applied to the set +after the grouping calculations have been done. In other words it is a +constraint just like L (and accepting the same +L) applied to the data +as it exists after GROUP BY has taken place. Specifying L without +L is a logical mistake, and a fatal error on most RDBMS engines. + +E.g. having => { 'count_employee' => { '>=', 100 } } or with an in-place function in which case literal SQL is required: - having => \[ 'count(employee) >= ?', [ count => 100 ] ] + having => \[ 'count(employee) >= ?', 100 ] =head2 distinct