Skip to main content

SQL node

Transform

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 n rows.

A statement in any other form, such as one with JOIN, GROUP BY, OR or a function, passes every row through unchanged.

Ports​

PortDirectionKindNotes
inindataRows, as the table __INPUT__.
outoutdataThe selected rows and columns.
erroroutcontrolReceives 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​

SymptomCauseWhat to do
Every row passes through unchangedThe 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 WHEREThe 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 emptyThe column name is misspelled.Check the upstream column names.