<font size=2 face="sans-serif"><br>
Ok, I understand how that works I think, but how/where do I integrate it
into my code as I am using Catalyst models and I'm very confused on this
one.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">fREW Schmidt &lt;frioux@gmail.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">&quot;DBIx::Class user and developer
list&quot; &lt;dbix-class@lists.scsys.co.uk&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">05/10/2012 12:08 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Dbix-class] Query translation</font></table>
<br>
<hr noshade>
<br>
<br>
<br>
<br><font size=3>SELECT<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.server_id,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a.account_code,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.server_name,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.server_type,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.os_name,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (select count(*) from server
ss, subsystem sb<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;where
ss.server_id = sb.server_id<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;and
ss.server_id = s.server_id) as num_subsystems<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; account a,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server s<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE a.account_id = s.account_id<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;order by a.account_code, s.server_name</font>
<br><font size=3><br>
Actually, I <b>just</b> released a helper that will do the correlated subquery
for you.&nbsp; Check it out here: </font><a href="http://search.cpan.org/~frew/DBIx-Class-Helpers-2.008000/lib/DBIx/Class/Helper/ResultSet/CorrelateRelationship.pm"><font size=3 color=blue><u>http://search.cpan.org/~frew/DBIx-Class-Helpers-2.008000/lib/DBIx/Class/Helper/ResultSet/CorrelateRelationship.pm</u></font></a><font size=3>
</font>
<br><font size=3>-- <br>
fREW Schmidt</font><font size=3 color=blue><u><br>
</u></font><a href=http://blog.afoolishmanifesto.com/><font size=3 color=blue><u>http://blog.afoolishmanifesto.com</u></font></a><tt><font size=2>_______________________________________________<br>
List: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</font></tt></a><tt><font size=2><br>
IRC: irc.perl.org#dbix-class<br>
SVN: </font></tt><a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/"><tt><font size=2>http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</font></tt></a><tt><font size=2><br>
Searchable Archive: </font></tt><a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk"><tt><font size=2>http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</font></tt></a>
<br>
<br>