title: Convert one column to multiple columns in postgres
body: <p>I have a table like this below : </p>
  
  <p><a href="https://i.stack.imgur.com/ugTeO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ugTeO.png" alt="enter image description here"></a></p>
  
  <p>Would like to change the format as below on postgres : </p>
  
  <p><a href="https://i.stack.imgur.com/DajXQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DajXQ.png" alt="enter image description here"></a></p>
  
  <p>I tried to use the case statement but did not give me desired results.
  Thank you in advance for the help !</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>select (case when column_1='A' then column_1 else 'other' end) column_1,
  (case when column_1='B' then Column_1 else 'other' end) column_2 from test_t
   where id= random_value;
  </code></pre>
  
  <p>Each time the query returns only 2 rows and the row values in the column_1 are dynamic and not fixed.</p>