Help for this page

Select Code to Download


  1. or download this
      SELECT department, count(department)
      FROM table
      GROUP BY department
    
  2. or download this
    use strict;
    
    ...
                             }
                             keys %testhash;
    print( "$musicstudents\n" );
    
  3. or download this
       my %outputhash = somefunction(\%testhash, 'department');
    
  4. or download this
      # my %outputhash = ( music => 3,
      #                    chemistry => 2 );
    
  5. or download this
      my %outputhash;
      $outputhash{$_->{department}}++ for grep { $_->{department}
                                                } values %testhash;