Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

JCR SQL2 query to find multi-value property with duplicate values?

Avatar

Avatar
Validate 1
Level 1
EricES
Level 1

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile

Avatar
Validate 1
Level 1
EricES
Level 1

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile
EricES
Level 1

26-09-2018

Is there a way to construct a SQL2 query that would find a multi-value property containing duplicate values?


For instance, we have a multi-value String property called "language". Can a SQL2 query find a node which contains two or more instances of 'en' (English) in the "language" property?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

26-09-2018

There is no count(*) or group by selector in JCR SQL , XPath [2] or JCR-SQL2/AQM [3].

So you can't do it with SQL2 query but you can run query like below to find all the nodes with 'en' and then again query each node to check duplicate value using Node API

example -

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/AEM63App/fr]) and CONTAINS(s.language, 'en')

Answers (0)