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”.
Hi,
You can also use the DB Query Extractor node to turn the Select column2 from TableB into a flow variable. Then do the same with the Select * from TableA (both queries can be generated using KNIME DB nodes). Now you have two parts of your query as strings and you can use a String Manipulation node to connect them with the IN operator. Then you can use the DB Query Injector to turn the new query into a DB Data port. The whole logic can easily be wrapped into a component for reusability.
Kind regards,
Alexander
The data in TableA is very large, so the joiner node is taking a long time and that’s the reason I am trying to explore different options. Let me check the thread and see if that helps