From: Jess Robinson Date: Sat, 14 Oct 2006 19:41:07 +0000 (+0000) Subject: Add func example for resultsetcolumn X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=709353afc62951025fc2d497eb0f33bd6052a98a;p=dbsrgits%2FDBIx-Class-Historic.git Add func example for resultsetcolumn --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 7fed731..a9b9aaa 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -442,6 +442,17 @@ Or just iterate through the values of this column only: print $c; } +C only has a limited number of built-in functions, if +you need one that it doesn't have, then you can use the C method +instead: + + my $avg = $cost->func('AVERAGE'); + +This will cause the following SQL statement to be run: + + SELECT AVERAGE(Cost) FROM Items me + +Which will of course only work if your database supports this function. See L for more documentation. =head2 Using relationships