0Day Forums
How to do an ORDER BY ignoring the diacritical marks (use a collation) in Cypher? - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: Database (https://0day.red/Forum-Database)
+---- Forum: Neo4j (https://0day.red/Forum-Neo4j)
+---- Thread: How to do an ORDER BY ignoring the diacritical marks (use a collation) in Cypher? (/Thread-How-to-do-an-ORDER-BY-ignoring-the-diacritical-marks-use-a-collation-in-Cypher)



How to do an ORDER BY ignoring the diacritical marks (use a collation) in Cypher? - foreleg291 - 07-27-2023

I have a list of names where some names contain diacritics characters, like `Á`, `Ê`

For example:

Átila
André
Êlisa
Mercês


But when I run a simple query like this:

MATCH (p:Person)
ORDER BY p.Name

It returns the names out of alphabetical order, because of the diacritics:

André
Mercês

Átila
Êlisa

I would like that it return in alphabetical order, independently of the presence of diacritics (pt-BR / portuguese / Brazil).

I can do this in Microsoft SQL Server:

SELECT Name
FROM Person
ORDER BY Name COLLATE SQL_Latin1_General_CP1_CS_AS

How to do that in Cypher?