title: SQL query with WHERE and LIKE not working
body: <p>Hi I am developing an android app.I have a DB table NUMBERRECEIVED with a field phnnofrmDb VARCHAR. I need to compare these db numbers with the phone numbers entered by the user in a textview.</p>
  
  <p>This is what is the code I am trying </p>
  
  <pre><code>while (c.moveToNext()) 
  {
  
      //phone number entered in text view
       **contactNumber** 
  
          db = openOrCreateDatabase("Test", 0, null);
          Cursor cur = db.rawQuery("SELECT count(*) FROM NUMBERRECEIVED ", null);
          if (cur.getCount() &gt; 0)
          {
            Cursor cursor = db.rawQuery("SELECT phnnofrmDb FROM NUMBERRECEIVED WHERE phnnofrmDb Like '%contactNumber' ", null);
            if (cursor != null &amp;&amp; cursor.moveToFirst()) 
            {
              phnnofrmDb = cursor.getString(cursor.getColumnIndex("phnnofrmDb "));
  
              if(phnnofrmDb.contains(r_address))
              {
                  Log.e("same","true");
  
              }
              else if(!phnnofrmDb.contains(r_address))
              {
                  Log.e("same","false");
              }
            }cursor.close();
          } cur.close();
           db.close();
  }c.close();
  </code></pre>
  
  <p>But the Log says "true" always. I may be going wrong in the query. Please suggest how to resolve this and the user may enter numbers like +9195*<strong><em>*</em></strong> or +44*<strong><em>*</em>**</strong> or just  the number like 81*<strong><em>*</em>**</strong>. How do I compare them excluding the + and country code(+91). Please Suggest.</p>
  
  <p>Thanks!</p>