Help for this page

Select Code to Download


  1. or download this
       select sum(whatever)
       from
    ...
          -- whole pile of stuff omitted --
       group by
          -- another pile of things
    
  2. or download this
      $sth->execute($foo, $bar, $rat) or die $sth->errstr, $/;
      my $sum = $sth->fetchrow_arrayref->[0];
      $sth->finish;
    
  3. or download this
      $sth->execute($foo, $bar, $rat) or die $sth->errstr, $/;
      my $r = $sth->fetchrow_arrayref;
      my $sum = $r ? $r->[0] : 0;
      $sth->finish;
    
  4. or download this
      $sth->execute($foo, $bar, $rat) or die $sth->errstr, $/;
      my $sum = ($sth->fetchrow_arrayref || [0])->[0];
      $sth->finish;