SQLite SELECT equal to one of two values
10,928
Solution 1
WHERE sendID = ? OR sendID = ?
or
WHERE sendID IN (?, ?)
Solution 2
(SELECT * FROM messages WHERE sendID = ? OR sendID = ? ORDER BY timeStamp ASC', id1, id2)
Author by
Leonardo Amigoni
Updated on June 07, 2022Comments
-
Leonardo Amigoni almost 2 years
I am trying to get the messages where the sendID is equal to one of two values. This is the statement 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 to do this?
Thanks