title: Join tables in Hive using LIKE
body: <p>I am joining <code>tbl_A</code> to <code>tbl_B</code>, on column <code>CustomerID</code> in <code>tbl_A</code> to column <code>Output</code> in <code>tbl_B</code> which contains <code>customer ID</code>. However, <code>tbl_B</code> has all other information in related rows that I do not want to lose when joining. I tried to <code>join</code> using <code>like</code>, but I lost rows that did not contain <code>customer ID</code> in the output column. </p>
  
  <p><a href="https://i.stack.imgur.com/gpNXv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gpNXv.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/nIAfG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nIAfG.png" alt="enter image description here"></a></p>
  
  <p>Here is my join query in Hive:</p>
  
  <pre><code>select a.*, b.Output from tbl_A a
  left join tbl_B b
  On b.Output like concat('%', a.CustomerID, '%')
  </code></pre>
  
  <p>However, I lose other rows from output. </p>