RETURN clause defines which properties and values the result-set will contain.
Basic Usage
The basic structure is a comma-separated list ofalias.property expressions:
Removing Duplicates
Use theDISTINCT keyword to remove duplicate values from the result-set:
DISTINCT ensures that Dominick appears only once in the final result set.
Aggregations
TheRETURN clause can also aggregate data, similar to SQL’s GROUP BY functionality.
When an aggregation function is used in the RETURN list, all non-aggregated values become implicit grouping keys:
Supported Aggregation Functions
For detailed information on aggregation functions, see the Functions documentation.
Frequently Asked Questions
How do I remove duplicate results?
How do I remove duplicate results?
Use
RETURN DISTINCT followed by the expression or alias to eliminate duplicate rows from the result set.How does GROUP BY work in FalkorDB?
How does GROUP BY work in FalkorDB?
FalkorDB uses implicit grouping. When an aggregation function (like
count, sum, avg) appears in RETURN, all non-aggregated expressions automatically become grouping keys, similar to SQL GROUP BY.Can I return all properties of a node?
Can I return all properties of a node?
Yes. Simply return the alias without a property accessor, e.g.
RETURN movie. This returns the full entity including all labels and properties.What aggregation functions are available?
What aggregation functions are available?
FalkorDB supports
avg, collect, count, max, min, percentileCont, percentileDisc, stDev, and sum.