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;

Example

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

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment