title: mutating table when writing a trigger
body: <p>I have been bogged in this problem for quite a long time....Can anyone help me out?<br>
  Here is the thing I want to implement:
  I have a table A, A has attributes: id, count, total. Here I am required to implement such a trigger: IF the count in table A is updated, the trigger will set the total to 1. </p>
  
  <p>My initial code is like this: </p>
  
  <pre><code>    CREATE OR REPLACE TRIGGER tri_A AFTER UPDATE OF count ON A
      FOR EACH ROW
      BEGIN
      UPDATE A SET total = 1 WHERE id = :new.id;
      END;
      /
  </code></pre>
  
  <p>The problem with this is the mutating table. When the table is updated, the table will be locked. I searched for the answers, I tried pragma autonomous_transaction, but I got an invalid trigger specification error. And there are other comments saying that we should try to use a combination of triggers to do this....I can't figure out how to do this </p>