How do I have a select query inside a where clause?

Hi @cesc34, and welcome to the KNIME community.

If the “TableB” data is already in a KNIME table, but you wish to use it in the SQL query, your options are to either manually turn the “Column2” values into a comma delimited string, held in a flow variable, which can then be used in the select statement against TableA, or an alternative is to use the DB Looping node.

Take a look at this thread, where both these approaches are referenced:

If the data in TableA is not massive, you could also simply return all the rows from TableA using a DB Query Reader and then use a Joiner node to join column1 to the column2 data that has been returned from TableB, but whilst less efficient, this approach can be perfectly valid, for a “quick win”.

2 Likes