select cx.*, ci.live_revision, ci.latest_revision, ci.locale, ci.publish_status, ci.content_type, ci.storage_type from ${table_name} cx, cr_items ci where ci.${revision}_revision = cx.revision_id and ci.item_id = :item_id select name from cr_items where parent_id = :parent_id select cf.*, ci.name, ci.item_id, ci.live_revision, ci.latest_revision, ci.locale, ci.publish_status, ci.content_type, ci.storage_type from cr_folders cf, cr_items ci where ci.item_id = cf.folder_id and ci.item_id = :item_id select item_id from cr_items where name = :name and parent_id = :parent_id