I've faced with a duplicate rows issue when I use JCR-SQl2 query for getting data in AEM 6.3.1. I attached the SQl2 query below.
SELECT s.* FROM [rep:User] AS s
LEFT OUTER JOIN [nt:base] AS c ON
ischildnode(c, s)
WHERE (ISDESCENDANTNODE(s,"/home/users"))
and s.[rep:authorizableId] = {0} or c.[email] = {0}
Is there a way to use "Select DISTINCT"
statement in JCR-SQL2 query or something like that for removing the duplicate rows of result.