title: Pivoting in sql
body: <p>i have sql table with data as given below</p>
  
  <pre><code>    emp id     empname  dept
      -------    ----     ------
    1              a        Hr
    2              b        Hr
    3              c        Tech
    4              d        Hr
    5              e        Admin
    7              f        Tech
    8              g        Admin
  </code></pre>
  
  <p>Now i want to pivot the above table get the result like this</p>
  
  <pre><code>                Hr    Tech    Admin
                 -----  -----   -----
  Empname        a       c       e
  Empname        b       f       g
  Empname        d
  </code></pre>
  
  <p>I am just wondering is this even possible using pivoting in sql or there is any other mean to achieve this</p>