title: sql presto query to join 2 tables interatably
body: <p>I need to do this in the sql query. LEt me know if this possible</p>
  
  <p>I have a table which has a mapping like (table1)</p>
  
  <pre><code>num,value
  2,'h'
  3,'b'
  5,'c'
  </code></pre>
  
  <p>Now I have another table which have these values (table2)</p>
  
  <pre><code>name, config
  "test1",45
  "test2",20
  </code></pre>
  
  <p>Now what I want is the sql query which will add another column to my  table2 by checking if config column values are divisible by table1.num and if yes concat the table1.values to it</p>
  
  <p>so now after the sql query it should become</p>
  
  <pre><code>name, config, final
  "test1",45, bc
  "test2",20, hc
  </code></pre>
  
  <p>Please let me know if I can form a query for this</p>