How To Filter Node Output with SELECT Statements

When creating data flows in Coalesce, it's common to need to filter or limit data from an upstream node before passing it downstream. For example, selecting only the latest records or a subset of columns.

It's important to understand that nodes don't actively push data to downstream nodes. Instead, nodes are queried by consumers via SQL SELECT statements that stitch together the data flow graph.

This means any row limiting logic needs to be applied in consuming nodes, not publishing nodes.

Best Practice: Filter in Consuming Node in Join

The proper way is to place a WHERE condition in consuming node JOIN clause.

SELECT * 
FROM MyNode
WHERE RowNum = 1

Now only row 1 will be created in the database object defined by the node.


Not Recommended: Filtering in Publishing Node

You CANNOT do this, for example in Post SQL.

SELECT * FROM MyNode WHERE RowNum = 1

This won’t actually filter what data reaches subsequent nodes.