$db->update() returns the affected amount of rows.
There is no Zend_DB method for insert ... on duplicate key update ..., so one should use the query() method:
$result = $db->query('INSERT INTO table(key, field) SELECT val1, val2 FROM table as t2 ON DUPLICATE KEY UPDATE field = VALUES(field)');
To find out the amount of affected or inserted records: $result->rowCount()
But this method also counts all the records that were updated with the same value.
I need to know all of the actual affected (changed) records.
Thanks!