title: perl/sql server query "re-ordered"
body: <p>Sorry for asking this question I am sure this was already answered somewhere else but I don't even know what keywords or how to explain it properly...
  So... I have this perl code that connects to sql server..</p>
  
  <pre><code>my $user = '';
  my $pass = '.';
  my $connection = "dbi:Sybase:server=;database=Adventure";
  my $dbh_SQL = DBI-&gt;connect($connection, $user, $pass) or die 'Cannot connect';
  my $query_cust_main = "
  SELECT BusinessEntityID,
         Title,
         FirstName,
         LastName,
         Suffix,
         JobTitle
  
  FROM HumanResources.vEmployee
  order by JobTitle";
  
  my $query_cust_sth = $dbh_SQL-&gt;prepare($query_cust_main);
  $query_cust_sth-&gt;execute();
  my $all_cust = $dbh_SQL-&gt;selectall_arrayref($query_cust_main, {Slice =&gt; {}});
  
  foreach my $data (@$all_cust){
  print $data-&gt;{BusinessEntityID}." ".$data-&gt;{FirstName}." ".$data-&gt;{LastName}." ".$data-&gt;{JobTitle}."\n";
  }
  </code></pre>
  
  <p>This code prints:
  12 Thierry D'Hers Tool Designer
  13 Janice Galvin Tool Designer
  2 Terri Duffy Vice President of Engineering
  25 James Hamilton Vice President of Production
  273 Brian Welcker Vice President of Sales</p>
  
  <p>Now, what i want to do...somehow is to re-order the results as this:</p>
  
  <p><strong>Vice President of Production</strong> </p>
  
  <p>25 James Hamilton</p>
  
  <p>273 Brian Welcker</p>
  
  <p><strong>Tool Designer</strong></p>
  
  <p>13 Janice Galvin </p>
  
  <p>12 Thierry D'Hers</p>
  
  <p>As in </p>
  
  <p><strong>JobTitle</strong> </p>
  
  <p>BusinessEntityID FirstName LastName ... </p>
  
  <p>Is is possible to obtain this re order only in perl? without using/altering the query?</p>
  
  <p>Thank you,
  R.</p>