Best commod offer <%perl> my $sth=$dbh->prepare( "SELECT a.commodname,b.price,b.qty,d.stallname,e.islandname FROM commods as a JOIN buy as b on a.commodid=b.commodid JOIN stalls as d on d.stallid=b.stallid JOIN islands as e on e.islandid=d.islandid GROUP BY d.islandid HAVING b.price=MAX(b.price) "); $sth->execute(); % my @row; % while (@row=$sth->fetchrow_array) { % foreach my $cell (@row) { % } % }
commodpriceqtyStallisland
<% $cell %>
<%init> use CommodsWeb; my $dbh= dbw_connect('Midnight');