Transform data visually in a database
Use DB Row Filter, DB GroupBy, and DB Joiner to manipulate data inside the database without writing SQL. Each node builds a SQL fragment and passes it downstream — the query only executes when a DB Reader node runs.
Before you begin
- Establish a database connection and select a table. See Read data from a database.
Filter rows with DB Row Filter
Configure a DB Row Filter node to build filter conditions on the connected table.
- Connect a DB Row Filter node to the DB Data output of a DB Table Selector.
- Click the node once to open its configuration.
- Set Match row if matched by to All criteria to combine criteria with AND logic, or Any criterion to combine them with OR logic.
- For each criterion, set:
- Filter column — the column to filter on.
- Operator — the comparison operator, for example
=,!=,<, or>. - Value — the value to compare against.
- Use the arrow icons to reorder a criterion, or the trash icon to delete it.
- Click Apply.
Aggregate with DB GroupBy
Configure a DB GroupBy node to group rows and calculate aggregations in the database.
- Connect a DB GroupBy node to the DB Data output of an upstream node.
- Click the node once to open its configuration.
- In the Groups tab, select the columns to group by.
- In the Manual Aggregation tab, select a column and choose an aggregation method (for example, AVG, SUM, COUNT).
- To count rows per group, tick Add Count(*) in Advanced Settings and set a name for the count column.
- Click Apply.
Join tables with DB Joiner
Configure a DB Joiner node to join two DB Data inputs into a single result.
- Connect two DB Data output ports to the two input ports of a DB Joiner node.
- Click the node once to open its configuration.
- Under Matching Criteria, set Match to All of the following to require every criterion to match, or Any of the following to require only one.
- For each criterion, select the joining column under Top input ('left' table) and Bottom input ('right' table). Click + Add matching criterion to add another criterion.
- Under Include in Output, tick Left unmatched rows to include rows from the top table with no match, or Right unmatched rows to include rows from the bottom table with no match.
- Under Output Columns, configure which columns to keep from each table:
- Use Manual, Pattern, or Type selection to move columns between Excludes and Includes.
- Repeat for both Top input ('left' table) and Bottom input ('right' table).
- Under If there are duplicate column names, select Remove duplicates or Append automatic numeric suffix to resolve column name conflicts between the two tables.
- Click Apply.
Read the result
Connect a DB Reader node to the final DB Data output port and execute it to retrieve the result as a KNIME data table.