SELECT parentDocumentID FROM documents WHERE (siteID = ? or siteID is null) AND active = 1 AND ( NOT EXISTS ( SELECT * FROM roleAccess WHERE roleAccess.documentID = documents.documentID ) ) and documentID = ? AND activeFrom < CURRENT_TIMESTAMP AND activeUntil > CURRENT_TIMESTAMP ORDER BY [order],name;