title: how to find the closest string for a given string with SQL
body: <p>let me make my question clear.
  i have some pattern string like below in database,</p>
  
  <pre><code>0070m6nkfszczw8zzgswgzz8wzgz0
  
  0070m6nkfszczw8zzgswgzz8wzgz3
  
  0070m6nkfszczw8zzgswgzz8wzgza
  
  0070m6nkfszczw8zzgswgzz8wzgzb
  
  0070m6nkfszczw8zzgswgzz8wzgzc
  
  0070m6nkfszczw8zzgswgzz8wzgzd
  
  0070m6nkfszczw8zzgswgzz8wzgzf
  
  0070m6nkfszczw8zzgswgzz8wzgzg
  </code></pre>
  
  <p>for a input string :</p>
  
  <pre><code>0070m6nkfszczw8zzgswgzz8wzgze 
  </code></pre>
  
  <p>it is not in database, but i just want find the near record after insert it to database
  the question is :
  can i store the strings with order in database ?
  how can i get the closest ones ?
  for:<code>0070m6nkfszczw8zzgswgzz8wzgze</code> </p>
  
  <p>the previous one is: 
  <code>0070m6nkfszczw8zzgswgzz8wzgzd</code></p>
  
  <p>the next is: 
  <code>0070m6nkfszczw8zzgswgzz8wzgzf</code></p>
  
  <p>thanks </p>