postgresql7.1
update uv_card
set address= :address, phone1= :phone1, phone2= :phone2
where id_card= :card_id
update uv_card
set comm_student= :comm_student
where id_card= :card_id
select i.width, i.height, cr.title, cr.description, cr.publish_date
from acs_rels a, cr_items c, cr_revisions cr, images i
where a.object_id_two = c.item_id
and c.live_revision = cr.revision_id
and cr.revision_id = i.image_id
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'
select * from uv_card
where ref_user_id= :user_id
and ref_community_id= :community_id
insert into uv_card (ref_community_id, ref_user_id)
values (:community_id, :user_id)
select * from uv_card_base_note
where community_id = :community_id
select * from uv_card_xcent_note
where ref_community_id = :community_id
order by xcent desc
select ref_xcent, name_xcent, xcent, avg(value_n) as mitja
from uv_card_notes inner join
(uv_card_subtype_note inner join
uv_card_xcent_note on (ref_xcent = id_xcent))
on (ref_subtype = id_subtype)
where ref_id_card = :card_id and is_active = 'true'
group by ref_xcent,name_xcent,xcent order by ref_xcent asc
select * from uv_card_notes inner join
(uv_card_subtype_note inner join
uv_card_xcent_note on (ref_xcent = id_xcent))
on (ref_subtype = id_subtype)
where ref_id_card = :card_id
order by id_subtype desc
select ref_id_card, ref_xcent, name_xcent, xcent,
avg(value_n)*xcent*1.00/100.00 as mitja_p,
rvalor, np
from uv_card_notes n, uv_card_subtype_note sn, uv_card_xcent_note xn
where sn.ref_xcent = xn.id_xcent
and sn.ref_community_id = :community_id
and xn.ref_community_id = :community_id
and ref_id_card = :card_id
and n.ref_subtype = sn.id_subtype
and is_active = 'true'
and xcent<>0
group by ref_xcent,name_xcent,xcent,ref_id_card,rvalor,np
order by ref_id_card asc, xcent desc, ref_xcent asc
select count(np) as npn
from uv_card_xcent_note
where ref_community_id= :community_id and np<>'f'