Variable Not defined

This is my query

MATCH (n:SampleLabel)-[:R1]->(n2:Genus) WITH 
                genus_specie: n2.genus_specie
            } AS productDetails RETURN productDetails ORDER BY
            SKIP 0 LIMIT 50

When I execute it says

Neo.ClientError.Statement.SyntaxError: Variable `n` not defined (line 5, column 74 (offset: 220)) " } AS essentialOilDetails RETURN essentialOilDetails ORDER BY" ^


The variable n must be listed in the WITH clause in order for it to be available to the ORDER BY clause.

I solved it. It's working now I just had to replace with, thanks for the reply. :slight_smile: