You can call method -&gt;get_column(&#39;some_value&#39;)-&gt;min from resultset. <br>Also you can create your own ResultSet and add method<br><br>sub get_min_malue {<br>    shift-&gt;get_column(&#39;some_column&#39;)-&gt;min;<br>

}<br><br>So you can make such query:<br>$c-&gt;model(&#39;DB::Table&#39;)-&gt;get_min_value;<br>$c-&gt;model(&#39;DB::Table&#39;)-&gt;search( {type =&gt; 1} )-&gt;get_min_value;<br><br>But you will make three requests for min, max and avg functions. Or you can create other method in your resultset object which returns hash with needed values.<br>

<br>sub get_stats_data{<br>   return { min =&gt; 1, max =&gt; 2, avg =&gt; 3}<br>}<br><br><div class="gmail_quote">2009/9/22 Trevor Phillips <span dir="ltr">&lt;<a href="mailto:trevor.phillips@gmail.com">trevor.phillips@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/9/21 Андрей Костенко &lt;<a href="mailto:andrey@kostenko.name">andrey@kostenko.name</a>&gt;:<br>


<div class="im">&gt; You can create a view for this query. e.g.<br>
&gt; CREATE VIEW stats AS SELECT MIN(a), MAX(a), AVG(a) FROM table1;<br>
<br>
</div>I could, but it&#39;s not the query I&#39;m having a problem with - it&#39;s<br>
mapping it to columns within the pre-existing DBIx::Class. I&#39;d rather<br>
not have to create a whole new class simply for this single query<br>
against my data. I can see the data in the raw object - I just can&#39;t<br>
access it through the normal methods.<br>
<br>
Reading the manual, I should be able to get the value via get_column,<br>
but Catalyst/TT uses the column methods instead.<br>
<br>
Hmmm, I *can* use get_column within TT, but that seems to defeat the<br>
purpose of abstracting data from presentation.<br>
<br>
When getting the search results, I can map the rows with<br>
$_-&gt;get_columns(). That seems to be the easiest solution for now.<br>
<div><div></div><div class="h5"><br>
--<br>
Trevor Phillips  - <a href="http://dortamur.livejournal.com/" target="_blank">http://dortamur.livejournal.com/</a><br>
&quot;On nights such as this, evil deeds are done. And good deeds, of<br>
course. But mostly evil, on the whole.&quot;<br>
      -- (Terry Pratchett, Wyrd Sisters)<br>
<br>
_______________________________________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" target="_blank">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a><br>
</div></div></blockquote></div><br>