title: sql modify query with specific value to return as if executed for various specific values
body: <p>There are two tables:</p>
  
  <p>Firstly, <code>req_data</code>, which contains a column named <code>req_id</code>.</p>
  
  <p>Secondly, <code>tc_data</code> which contains a column named <code>Out-Link</code>. That column holds (possibly) multiple values of a possible <code>req_data.req_id</code> value.</p>
  
  <p>I got the following query</p>
  
  <pre><code>SELECT * FROM tc_data WHERE `Out-Link` LIKE '%//specific req_data.req_id value//%'
  </code></pre>
  
  <p>which returns for a specific value the results I want.I just don't know how to modify this query in order to get a result set which would look as if I would have executed the above query for every <code>req_data.req_id</code> value in the <code>req_data.req_id</code> column.</p>
  
  <p>I tried</p>
  
  <pre><code>SELECT * FROM tc_data INNER JOIN req_data ON tc_data.`Out-Link` LIKE CONCAT('%',req_data.req_id,'%')
  </code></pre>
  
  <p>with no luck (takes very long to execute and does not give desired result).</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>Sample data <code>req_data</code>:</p>
  
  <pre><code>     req_id         |  *some other columns...*
  -------------------------------------------------
  abc_ersed_1023      |  ...
  -------------------------------------------------
  dkd_asdf-2132       |  ...
  -------------------------------------------------
  mcd-sad_sdf_120323  |  ...
  </code></pre>
  
  <p>sample data <code>tc_data</code></p>
  
  <pre><code>    Out-Link         |   some other columns ...
  ---------------------|--------------------------
  dkd_asdf-2132        |...
  mcd-sad_sdf_120323   |
  ------------------------------------------------
  mcd-sad_sdf_120323   |...
  ------------------------------------------------
                       |...
  ---------------------|--------------------------
  abc_ersed_1023       |...
  ------------------------------------------------
  </code></pre>
  
  <p>Note that <code>req_id's</code> can occur in multiple rows in <code>tc_data</code>.</p>