Query[SQL/SQL2/Xpath/JCR] to be used to get the required data? | Community
Skip to main content
October 16, 2015
Solved

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

  • October 16, 2015
  • 3 replies
  • 1002 views

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.
Best answer by jura_khrapunov

SQL2:

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

3 replies

jura_khrapunovAccepted solution
October 16, 2015

SQL2:

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

askdctmAuthor
October 16, 2015

Hi Jura,

Thank you for your reply.

askdctmAuthor
October 16, 2015

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:%'