title: How to get almost matching string from Oracle table?
body: <p>I have a table in Oracle with four columns.
  <img src="https://i.stack.imgur.com/oD5ID.png" alt="Table Data in Oracle."></p>
  
  <p>Now user can enter input string as "operation Knee right" (which is valid) to my query and my query should return the ICD Code (IKR123) which matches most of the word in DiagnosisName column.</p>
  
  <p>Following is my current query.(Not giving the proper output)</p>
  
  <pre><code>SELECT diagnosisname
  FROM
    (SELECT diagnosisname,
      UTL_MATCH.jaro_winkler_similarity('%operation Knee right%',diagnosisname)
    FROM icd_code
    ORDER BY UTL_MATCH.EDIT_DISTANCE_SIMILARITY('%operation Knee right%',diagnosisname) DESC
    )
  WHERE ROWNUM&lt;2;
  </code></pre>
  
  <p>This query giving me the output as "Left Knee Operation" but my expectation is "Right Knee Operation".</p>