title: Convert table (column) values into independent rows
body: <p>I have a table with primary key as <code>(state+city)</code> and other <code>columns (product1, product2, product3, product4)</code>. I am trying to create a new table where each row will correspond to <code>(state+city)</code> &amp; (one of) products + some static_value columns. How do I do it in a PostgreSQL query? </p>
  
  <p>It's probably better to see examples of input and output data that I am looking at. I checked various examples of converting rows to columns in MySQL or SQL Server on this forum but they don't seem to help me.</p>
  
  <p>Example data sheet ('Input Table' and 'Desired Output' tabs)</p>
  
  <p><a href="https://docs.google.com/spreadsheets/d/1qQZhWXB_h80HfaDi6VOqeOs7CVNyW9gwtEd-GRqLHKc/edit#gid=1581374593" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1qQZhWXB_h80HfaDi6VOqeOs7CVNyW9gwtEd-GRqLHKc/edit#gid=1581374593</a></p>