postgresql7.1
select site_node__url(node_id) as package_url from site_nodes where object_id = (select package_id from cr_folders where folder_id= (select parent_id from cr_items where latest_revision = :object_id))
select name as url, parent_id as package_id
from cr_items
where live_revision = :object_id
select r.revision_id as object_id,
r.title as title,
content as content,
'text/html' as mime,
'' as keywords,
'text' as storage_type
from cr_revisions r
where revision_id = :object_id
select site_node__url(node_id) as package_url from site_nodes where object_id = (select package_id from cr_folders where folder_id= (select parent_id from cr_items where latest_revision = :object_id))
select name as url, parent_id as package_id
from cr_items
where live_revision = :object_id