


How to select multiple fields in a JCR-SQL2 query like such:
SELECT page.[jcr:created], page.[jcr:createdBy], page.[jcr:primaryType] FROM [cq:Page] AS page
INNER JOIN [nt:base] AS component ON ISDESCENDANTNODE(component, page)
WHERE component.[sling:resourceType] = '/libs/fd/af/components/aemform'
AND ISDESCENDANTNODE(page, '/content')
Currently it is only returning page relative paths, despite I have selected 3 fields in the query: page.[jcr:created], page.[jcr:createdBy], page.[jcr:primaryType].
Am I missing something here? Thanks!
Views
Replies
Sign in to like this content
Total Likes
Here's a query you can use.
Find me all cq:PageContent nodes, where properties exists: jcr:created, jcr:createdBy, jcr:primaryType
and it must be nodes under the paths of /libs/fd/af/components/aemform or /content
SELECT page.* FROM [cq:PageContent] AS page
WHERE page.[jcr:created] IS NOT NULL
AND page.[jcr:createdBy] IS NOT NULL
AND page.[jcr:primaryType] IS NOT NULL
AND (ISDESCENDANTNODE(page,'/libs/fd/af/components/aemform') OR ISDESCENDANTNODE(page,'/content'))
Here's a query you can use.
Find me all cq:PageContent nodes, where properties exists: jcr:created, jcr:createdBy, jcr:primaryType
and it must be nodes under the paths of /libs/fd/af/components/aemform or /content
SELECT page.* FROM [cq:PageContent] AS page
WHERE page.[jcr:created] IS NOT NULL
AND page.[jcr:createdBy] IS NOT NULL
AND page.[jcr:primaryType] IS NOT NULL
AND (ISDESCENDANTNODE(page,'/libs/fd/af/components/aemform') OR ISDESCENDANTNODE(page,'/content'))