Could anyone in group Validate below query to get count of all documents in a particular folder. Want to get experts in this forum to review this before providing numbers to users.
WITH cte_name
AS
(
select dataId, parentid, subtype
from dtree where dataid = '63318' --DISABILITY MASTER FOLDER ID IN QA
UNION ALL
select dt.dataid, dt.parentid, dt.subtype from dtree dt
inner join cte_name as cte
on dt.parentid = cte.dataId
)
SELECT count(1)
FROM cte_name
where cte_name.subtype in ('144')
Thanks, Manoj