select first_names, last_name, email,
coalesce(screen_name,'< none set up >') as screen_name,
creation_date, creation_ip, last_visit, member_state,
email_verified_p, url
from cc_users
where user_id = :user_id
select privilege
from acs_permissions
where object_id = 0
and grantee_id = :user_id
and privilege = 'admin'
select live_revision as revision_id,
coalesce(title,'view this portrait') as portrait_title
from acs_rels a, cr_items c, cr_revisions cr
where a.object_id_two = c.item_id
and c.live_revision = cr.revision_id
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'
select distinct lower(groups.group_name) as group_name
from groups, group_member_map gm
where groups.group_id = gm.group_id and gm.member_id=:user_id
order by lower(groups.group_name)
select group_id, rel_id, party_names.party_name as group_name
from (select /*+ ORDERED */ DISTINCT rels.rel_id, object_id_one as group_id,
object_id_two
from acs_rels rels
where rels.rel_type = 'membership_rel'
and rels.object_id_two = :user_id) r,
party_names
where r.group_id = party_names.party_id
order by lower(party_names.party_name)