title: How to separate multiple data in one row to multiple rows in SQL
body: <p>I have following tables in my application:</p>
  
  <pre><code>Table-1
  --------------------------------------
  |   id    |    column_2(array_type)   |
  --------------------------------------
  |    1    |    [20,21,22]             |
  --------------------------------------
  
  Table-2
  ---------------------------------------
  |    id   |    column_2(array_type)    |
  ---------------------------------------
  |    3    |    [31,32]                 |
  ---------------------------------------
  </code></pre>
  
  <p>Now I want to create a view as follows:</p>
  
  <pre><code>-----------------------------------------------------------------
  |   id    |    Table_1_id    |    Table_2_id    |    column_2    |
  -----------------------------------------------------------------
  |    1    |        1         |       nil        |      20        |
  -----------------------------------------------------------------
  |    2    |        1         |       nil        |      21        |
  -----------------------------------------------------------------
  |    3    |        1         |       nil        |      22        |
  -----------------------------------------------------------------
  |    4    |       nil        |       3          |      31        |
  -----------------------------------------------------------------
  |    5    |       nil        |       3          |      32        |
  -----------------------------------------------------------------
  </code></pre>
  
  <p>The view should have single row entry for every item in <code>column_2</code>'.</p>
  
  <p>Am unable to split the <code>column_2</code>'s array content to individual row and assign corresponding <code>table's</code> id to it.</p>
  
  <p>Any help or reference would be very helpful. I do not have much experience with SQL.</p>
  
  <p>Couldn't find much on this in google.</p>