SQL node
What it does
The SQL node applies a short SELECT statement to the upstream rows. The rows are the table __INPUT__. The statement can choose columns, keep rows where one column equals a value, and limit the number of rows.
The SQL node appears in flows that already contain it. It is not in the component browser. For full SQL over rows, use the Script node with DuckDB SQL.
When to use
- You are editing a flow that already has a SQL node.
- For new work: use a Script node for full SQL, a Filter to keep rows, and a Transform to choose columns.
Configure
Select the node and edit the statement. The supported form is:
SELECT <columns or *> FROM __INPUT__ [WHERE <column> = '<value>'] [LIMIT <n>]
- Columns:
*, or a comma-separated list of column names. - WHERE: one column compared with one quoted value. A row whose column is empty (null) never matches, including
= ''. - LIMIT: the first
nrows.
A statement in any other form, such as one with JOIN, GROUP BY, OR or a function, passes every row through unchanged.
Ports
| Port | Direction | Kind | Notes |
|---|---|---|---|
in | in | data | Rows, as the table __INPUT__. |
out | out | data | The selected rows and columns. |
error | out | control | Receives the input rows when the node fails. |
Examples
Sales rows only.
SELECT * FROM __INPUT__ WHERE DEPT = 'Sales' LIMIT 100
Three columns.
SELECT id, name, email FROM __INPUT__
Troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
| Every row passes through unchanged | The statement is not in the supported form, or the table is not __INPUT__. | Use the form above, or move the query to a Script node. |
| No rows match the WHERE | The value differs in case or spaces, or the column is empty. | Check the exact value. Use a Filter for case-insensitive matching. |
| A selected column is empty | The column name is misspelled. | Check the upstream column names. |