I'm having trouble with translating this query
SELECT [EmailAddress], [CustomerName] FROM [Customers] WHERE [EmailAddress] IN
(SELECT [EmailAddress] FROM [Customers] GROUP BY [EmailAddress] HAVING COUNT(*) > 1)
I'm having trouble with translating this query
SELECT [EmailAddress], [CustomerName] FROM [Customers] WHERE [EmailAddress] IN
(SELECT [EmailAddress] FROM [Customers] GROUP BY [EmailAddress] HAVING COUNT(*) > 1)
The sql query is finding the email addresses and corresponding customers for emails that are used by more than one customer.
What is your neo4j data model? Are you storing the email address as a property of a Customer node? The query to achieve what you want would not be very efficient with this model.
Considering you think an email can be used by multiple people, then each Customer linked to an Email node with the email address as a property would make finding those customers very easy.