title: Delete SQLite Row with where clause with multiple clauses
body: <p>I've been searching around and not managed to find a solution or working example so here goes.</p>
  
  <p>I've set up an SQLite database which has five columns with different fields which effectively builds a list for the user. There will be multiple values in the list that are the same, save for the ROWID which is set to auto increment. </p>
  
  <p>Neither the user nor the program will know the ROWID once a value has been entered into the database, so I want for the user to be able to remove one row if it contains all four of the other fields.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>Database
              .delete(DATABASE_TABLE,
                      "KEY_DATE='date' AND KEY_GRADE='style2' AND KEY_STYLE='style' AND KEY_PUMPLEVEL='pumpLevel'",
                      null);
  </code></pre>
  
  <p>But this does not remove any values. I'm almost certain that the syntax of this command is to blame.</p>
  
  <p>How do I format a where clause for delete command with multiple where clauses?</p>
  
  <p><strong>Solution from below:</strong></p>
  
  <pre><code>ourDatabase.delete(DATABASE_TABLE, "ROWID = (SELECT Max(ROWID) FROM "
              + DATABASE_TABLE + " WHERE " + "date=? AND grade=? AND "
              + "style=? AND pump_level=?)", new String[] { date, grade,
              style, pumpLevel });
  </code></pre>