select count(revision_id) from cr_revisions where item_id = ( select item_id from cr_revisions where revision_id = :man_id ) select item_id from cr_items where name = :instance and parent_id = :root_folder select count(*) as submanifests from ims_cp_manifests where man_id = :man_id and parent_man_id = :man_id