title: Use CTE to generate test data in SQL
body: <p>I am trying to use a CTE to generate a data table for a unit test in SQL (postgresql).</p>
  
  <pre><code>WITH temp1 AS (
  SELECT
    ('A', 'A', 'B', 'B') AS grp,
    (1, 2, NULL, 1) AS outcome
  )
  
  SELECT * 
  FROM temp1
  </code></pre>
  
  <p>The above query is generating a single row rather than a 4-row table that would be useful to my unit test. How can I generate the 4-row table in the form: </p>
  
  <pre><code>grp.....outcome
  A.......1
  A.......2
  B.......NULL
  B.......1
  </code></pre>