title: How to generate "fake" rows in PostgreSQL to use for d3.js
body: <p>i have a query that compares date but the problem i need the column name to be a row.
  This the query i have:</p>
  
  <pre><code>SELECT
  ROUND(AVG(availability_percentage)
     FILTER (WHERE availability_date BETWEEN '2020-03-01' AND '2020-04-01') , 2) AS avg_march,
  ROUND(AVG(availability_percentage)
     FILTER (WHERE availability_date BETWEEN '2020-04-01' AND '2020-05-01'), 2) AS avg_april
  </code></pre>
  
  <p>FROM dashboard.availability
  WHERE availability_date BETWEEN '2020-03-01' AND '2020-05-01';</p>
  
  <p>as you can see I'm comparing the result of the average percentage on march and april but the problem is the avg_march and avg_april are column names. I need it to be a row result so that i can convert it to JSON and use it on D3.js on a bar chart. </p>
  
  <pre><code>avg_march    avg_april
  _________    _________
   98.28        95.60
  </code></pre>
  
  <p>but the result i need is:</p>
  
  <pre><code>month        average 
  _________    _______
  avg_march     98.28
  avg_april     95.60
  </code></pre>