title: Select query to check the existing record in the SQLite Database in android
body: <p>I want to know the Query to check whether the particular Record in the DataBase already exists or not for my application.</p>
  
  <p>I have made one function for these, but it is not working properly.</p>
  
  <pre><code>public boolean ifExisting(String name) {
      Cursor c = db.rawQuery("SELECT * FROM " + TABLE_NAME + "WHERE" + "name" + "=" + name, null);
      if(c.getCount() == 0)
       return false; 
  else
       return true;
  }
  </code></pre>
  
  <p>This is the place where I need to perform the function of checking for the Duplication Process.</p>
  
  <pre><code>if(dh.ifExisting(dataVector.get(position)) == true) {
  
  } else {
  dh.insert(dataVector.get(position));
  } 
  </code></pre>
  
  <p>Can anybody please help me.</p>
  
  <p>Thanks,
  david</p>