title: How to pass specific string to get the specific value from database android
body: <p>I have three columns where trailer_number and trailer_id are strings</p>
  
  <pre><code>id   trailer_number  trailder_id
  1       trailer1       766
  2       trailer2       899
  3       trailer3       577
  </code></pre>
  
  <p>Now if I pass the trailer_number, how to get the specific trailer_id.
  Say for eg: trailer1 if i pass, how to return the string "766"? </p>
  
  <p>I can do only if that specific string is exist or not but I am cluless how to pass to get the specific id. </p>
  
  <pre><code>public boolean isExist(String strTrailerNumber) {
          SQLiteDatabase db = this.getReadableDatabase();
          Cursor cur = db.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE TRAILER_NUMBER = '" + strTrailerNumber + "'", null);
          boolean exist = (cur.getCount() &gt; 0);
          cur.close();
          db.close();
          return exist;
  
      }
  </code></pre>