title: How to add child elements attached to parents, through an association table?
body: <p>I have two tables, the first is an association between parent and child table. Another table contains the contacts attached to parents, I want to add contacts parents to each of their children.
  I do not see how to build the sql query</p>
  
  <p>First Table association
  "Levels"</p>
  
  <p>Level_id_parent   Level_id_child</p>
  
  <pre><code>1               4
  1               5
  2               6
  3               7
  3               8
  3               9
  </code></pre>
  
  <p>Second Table "Contact"</p>
  
  <pre><code>Level_id   Contact_id   Visible
  1            45           1
  1            56           0
  1            73           0
  2            12           1
  2            13           1
  3            122          0
  </code></pre>
  
  <p>In the table "Contact", I want to add the contacts corresponding to LEVEL_1 LEVEL_2.
  For the following result:</p>
  
  <pre><code>Level_id   Contact_id   Visible
  1            45           1
  1            56           0
  1            73           0
  2            12           1
  2            13           1
  3            122          0
  ----------------------------
  4            45           1
  4            56           0
  4            73           0
  
  5            45           1
  5            56           0
  5            73           0
  
  6            12           1
  6            13           1
  
  
  7            122          0
  
  8            122          0
  
  9            122          0
  </code></pre>
  
  <p>should I use a cursor to do this? I'm lost.
  Thanks for your help.</p>