sql – PostgreSQL Select where multiple OR statements

sql – PostgreSQL Select where multiple OR statements

SELECT * 
FROM comments 
WHERE session_id=1 
  AND user_id in (10,11,12,13,14,15,16);

alternatively for this specific case:

SELECT * 
FROM comments 
WHERE session_id=1 
  AND user_id between 10 and 16;

sql – PostgreSQL Select where multiple OR statements

Leave a Reply

Your email address will not be published.