update contact_c
set c_log_antal = result.antal
from contact_c,
(select po_log.c_id as id, count(*) as antal from po_log group by po_log.c_id) as result
!!select must work alone!!
where contact_c.c_id = result.id;
update contact_c
set c_log_antal = result.antal
from contact_c,
(select po_log.c_id as id, count(*) as antal from po_log group by po_log.c_id) as resultatfil
where contact_c.c_id = result.id and
c_log_antal <> resulta.antal
;
Here optimize to only update when the 2 values are different
Firebird – GFIX syntax
gfix -user SYSDBA -password masterkey localhost:f:\ul\blank.fdb -v -f
Need more help with this?
DON'T HESITATE TO CONTACT US HERE ..