SQLite SELECT equals one of two values

I am trying to get messages in which the sendID is one of two values. This is an assertion that I have, but it seems to spit out only the messages associated with the first sendID.

(SELECT * FROM messages WHERE sendID = ? AND ? ORDER BY timeStamp ASC', id1, id2) 

Can anyone suggest a good method for this?

thanks

+7
source share
2 answers
  WHERE sendID = ? OR sendID = ? 

or

  WHERE sendID IN (?, ?) 
+17
source
 (SELECT * FROM messages WHERE sendID = ? OR sendID = ? ORDER BY timeStamp ASC', id1, id2) 
+1
source

All Articles