title: how to split single column values into multiple columns based on other column values
body: <p>I am trying to split single column values into multiple columns based on another column value, I could get it but I am unable to remove the additional null values I get</p>
  
  <p><b>table</b></p>
  
  <pre><code>create table tbl1
  (id int, strtype varchar(50), strvalue varchar(20));
  
  insert into tbl1 values
  (1, 'name', 'a'),(1, 'value', 'a1'),(1, 'name', 'b'),(1, 'value', 'b1');
  </code></pre>
  
  <p><b>Desired output</b></p>
  
  <pre><code>NAME    VALUE
  a       a1
  b       b1
  </code></pre>
  
  <p><b>sql i tried</b></p>
  
  <pre><code>select 
  (case when strtype='name' then strvalue end) as name,
  (case when strtype='value' then strvalue end) as value
  from tbl1
  </code></pre>