postgresql7.1
SELECT owner_id FROM dotfolios WHERE node_id = :node_id
SELECT username FROM users WHERE user_id = :owner_id
SELECT live_revision as revision_id, item_id
FROM acs_rels a, cr_items c
WHERE a.object_id_two = c.item_id
AND a.object_id_one = :owner_id
AND a.rel_type = 'user_portrait_rel'
order by item_id desc limit 1
SELECT last_name || ', ' || first_names AS adviser_name,
user_id AS adviser_id
FROM dotfolio_users WHERE type = 'adviser'
SELECT dotfolio__adviser_p (:user_id)
SELECT node_id
FROM dotfolios d
WHERE owner_id = :user_id
SELECT user_id FROM dotfolio_users WHERE username = :username
SELECT rel_id
FROM dotfolio_users
WHERE user_id = :user_id
SELECT type
FROM dotfolio_users
WHERE user_id = :user_id