How to perform multiple selects without using for loop I am querying for ids using a for-loop. So multiple selects are being used. Is there a better way to do this to have a single select statement for all ids?

for id in aoi_ids:
    sql = """SELECT id, date, col3 FROM table1 WHERE id=%s"""
    params = [id] 

    return helper_func_to_execute_query(sql, params)


I know once way is to use another table. Any other faster way to do it?
If you can sanitize input, you can use an IN statement.

SELECT *
FROM t
WHERE id IN ( 1,2,3 );


Or you can chain the WHERE clauses.

WHERE ID = 1 OR ID = 2;