Need SQL2 query for AEM 6.2
Hi,
Please help me in writing SQL2 query to search for all the pages containing custom component property.
I have custom "bodycopy" component which has a property called "myproperty". Below are the sample paths.
Conditions:
I can have any number of bodycopy components in "head-parsys" and at any level.
Fulltext search
Query should be performed on cq:Page
/content/mysite/jcr:content/head-parsys/bodycopy
/content/mysite/jcr:content/head-parsys/bodycopy_0
/content/mysite/jcr:content/head-parsys/parsys_1/bodycopy
/content/mysite/jcr:content/head-parsys/parsys_1/bodycopy_0
Below is the sample:
select * from [cq:Page] as a where contains([dynamic/path/to/mycomponent/myproperty],'test') and isdescendantnode(a, '/content/mysite')
Thanks in advance.