将 2 个 JCR-SQL2 查询合并为 1 个查询

问题描述 投票:0回答:0

我需要将这两个查询合并在一起:

查询1

SELECT page.* FROM [cq:Page] AS page INNER JOIN [nt:base] AS component ON isdescendantnode(component,page) WHERE 组件。[吊索:资源类型] ='wcm/foundation/components/responsivegrid'

此查询返回所有具有资源类型组件的页面

wcm/foundation/components/responsivegrid

查询2

SELECT * FROM [nt:base] 作为 s WHERE ISDESCENDANTNODE([/content/en-us/homepage/jcr:content])

此查询返回

jcr:content
下的所有组件,该页面路径为“/content/en-us/homepage”

我想使用查询 1 中的页面 url 列表并应用于查询 2 并替换此路径“/content/en-us/homepage”。

这是我所拥有的,但它显示了

 expected: static operand
的错误:

SELECT * FROM [nt:base] AS s WHERE s.[sling:resourceType] ='wcm/foundation/components/responsivegrid' AND s.[jcr:path] IN ( SELECT page.[jcr:path] FROM [cq:Page] AS page INNER JOIN [nt:base] AS 组件 ON isdescendantnode(component, page) WHERE 组件。[吊索:资源类型] ='wcm/foundation/components/responsivegrid' )

JCR-SQL2 中正确的语法应该是什么?

adobe aem jcr-sql2 adobe-exprience-manager
© www.soinside.com 2019 - 2024. All rights reserved.