title: Compare rows two tables
body: <p>I want to compare rows value from one table with rows value from another table. Structure of the first table is :</p>
  
  <p><img src="https://i.stack.imgur.com/YHn2p.png" alt="Structure of table"></p>
  
  <p>The other table is more complex than first table and have the same structure but number of rows is million rows, by the way first have 60.000 rows.</p>
  
  <p>I need to compare these two tables by <code>biling_profiles</code> so I have an insight into the price but that billing profile turn in the column. It's easily done using the left outer join because approximately 6 or 7 <code>billing_profiles</code> . Next thing I need is that if the other table has no value (for example, the first table has row with (destination 201425, cost 2,624) and the other does not , then I have trimmed one character from right to left and then search (destination - 20142). If no again result i repeat again trim from right to left (destination - 2014), when i found same destination then show in table)</p>
  
  <p>So, how to solve that ?</p>