cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Concat attributes as string

Hi,

I would like to concatenate attributes like

RETURN a.x + ',' + a.y

The problem is when y doesn't exist it returns null:

a.x + ',' + null - returns null instead of a.x

Any idea why it works this way and how to correctly concat attributes ?

Regards,
Cezary

2 REPLIES 2

intouch_vivek
Graph Steward

Hi Cezary,

try RETURN COALESCE(a.x ,"") + ',' + COALESCE(a.y ,"")

Regards
Vivek

Hi Vivek,

Thank you 🙂 it works!

Best,
Cezary