title: How can I compare two columns for similarity in SQL Server?
body: <p>I have one column that called 'message' and includes several data such as fund_no, detail, keywords. This column is in table called 'trackemails'.</p>
  
  <p>I have another table, called 'sendemails' that has a column called 'Fund_no'.</p>
  
  <p>I want to retrieve all data from 'trackemail' table that the column 'message'  contains characters same as 'Fund_no' in 'trackemails' Table.</p>
  
  <p>I think If I want to check the equality, I would write this code:</p>
  
  <pre><code>select
  case when t.message=ts.fund_no then 1 else 0 end
  from trackemails t, sendemails s
  </code></pre>
  
  <p>But, I do want something like below code:</p>
  
  <pre><code>select
  case when t.message LIKE ts.fund_no then 1 else 0 end
  from trackemails t, sendemails s
  </code></pre>
  
  <p>I would be appreciate any advice to how to do this:</p>