title: Union rows to columns in SQL server
body: <p>This is the table "tbltask",</p>
  
  <pre><code>task    Ship_Operator   Pick_Operator   Pack_Operator
  1       john            kevin           steve
  2       kevin           kevin           john
  3       steve           john            john
  4       steve           steve           steve
  5       john            steve           john
  </code></pre>
  
  <p>Now I need to get the total amount for everyone: ship, pick, pack </p>
  
  <pre><code>name    ship Total  pick Total  pack Total
  john    2           1           3
  kevin   1           2           0
  steve   2           2           2
  </code></pre>
  
  <p>I can use three statement to get the result:</p>
  
  <pre><code>select [Ship_Operator] ,count(*) as task_total  from tbltask 
  where [Ship_Operator] in ('john','kevin','steve')
  group by [Ship_Operator]
  
  select [Pick_Operator] ,count(*) as task_total from tbltask 
  where [Pick_Operator] in ('john','kevin','steve')
  group by [Pick_Operator]
  
  select [Pack_Operator] ,count(*) as task_total from tbltask 
  where [Pack_Operator] in ('john','kevin','steve')
  group by [Pack_Operator]
  </code></pre>
  
  <p>Is it possible to use one SQL statement?
  Your help will be appreciated!</p>