How can I return two lists that are DISTINCT
? I use UNWIND
clause to do that with one, but the problem arises when I want to have two independent lists with DISTINCT
elements.
Here is my code:
WITH [1,1,1,2,2,3]AS list, [2,3,4,5,6,7,1,2,1]as list2
UNWIND listAS listElement
UNWIND list2AS listElement2
WITHDISTINCT listElement, listElement2
RETURN collect(listElement)AS distinctElements, collect(listElement2)AS distinctElements2;
I want to get two lists with DISTINCT elements, and now I get duplicates. What am I doing wrong?