Skip to main content
Level 9
Oct 16, 2015 2:28 AM UTC
Solved

Query[SQL/SQL2/Xpath/JCR] to be used to get the required data?

Hi All,

There are multiple pages in author under /content. Suppose each page has a property as below :

Name    Type      Value
Custom  String[]  old:asdf,old:qwer,new:hjkl

NOTE : There are hundreds of property values which starts with "old:" notation

Suppose, I want to find out all the pages, which has old:xxx[where xxx represents some value present]
as a value in 'Custom' property. 

Probably a query[JCR/Xpath/SQL/SQL2 has to be run to find this out]. Not sure which one is the most efficient here.

Can you please provide me with the query that can be used to find out the results.

Any thoughts on this will be really helpful.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
jura_khrapunovAccepted solution
Level 3
Oct 16, 2015 2:28 AM UTC

SQL2:

SELECT * FROM [nt:unstructured] WHERE ISDESCENDANTNODE('/content') AND Custom = 'old:xxx'

3 replies

askdctmAuthor
Level 9
Oct 16, 2015 2:28 AM UTC

Hi All,

Can you please let me know which is more efficient of the below two queries.

SELECT * FROM [nt:unstructured] WHERE ISDESCENDANTNODE('/content') AND CONTAINS(Custom, 'old:')


SELECT * FROM [nt:unstructured] WHERE ISDESCENDANTNODE('/content') AND Custom like 'old:%'  

Translate
askdctmAuthor
Level 9
Oct 16, 2015 2:28 AM UTC

Hi Jura,

Thank you for your reply.

Translate
jura_khrapunovAccepted solution
Level 3
Oct 16, 2015 2:28 AM UTC

SQL2:

SELECT * FROM [nt:unstructured] WHERE ISDESCENDANTNODE('/content') AND Custom = 'old:xxx'

Translate