title: how to select record whose matching percentage is higher than other using like operator in sql server?
body: <p>I have set of records which I need to search using criteria. But criteria is returning me multiple rows.</p>
  
  <p>So I need top 2 records which are having maximum percentage of criteria matching.</p>
  
  <p>I worked on fuzzy logic but found that it is too complex for such simple problems. I have scenarios like below:</p>
  
  <pre><code>SELECT DISTINCT FirstName, LastName, CountryName, StateName FROM Employee
  </code></pre>
  
  <p>Say for example above one is returning me 5 records.</p>
  
  <p>What I want is like use "like" operator thru which I can find that statename like '%Gujarat%' &amp; countryname like '%India%' matching percentage with above five records.</p>
  
  <p>Once I got this matching percentage, I will select top 2 records with highest amount of matching percentage.</p>
  
  <p>This will lead me to get somewhat accurate data.</p>
  
  <p>Any idea using sql server?</p>