How to fetch data from SQL and use it as filter condition

Thanks for the example. In the final filter you select a specific element by doing sqlValues[0]
How can I filter for all the values in sqlValues. Ideally I would avoid contains() because of known performance issue