I have an array of strings that need to be checked if exists in a table before inserting them in order to avoid duplicates. What is the SQL query and how do I substitute the
Just do like
Cursor cursor = null; String sql ="SELECT PID FROM "+TableName+" WHERE PID="+pidValue; cursor= db.rawQuery(sql,null); Log("Cursor Count : " + cursor.getCount()); if(cursor.getCount()>0){ //PID Found }else{ //PID Not Found } cursor.close();