I have 2 columns in 2 different tables: col1 ->table1 and col2 -> table2 . One of them contains values that are not UNIQUE and the other one stores the times each values of table1 appeared. I need to create a trigger that will re-calculate col2 on update of col1. I read somewhere that you can not query the updating table in trigger, then how can i do this? Can anyone help me?
table1: pri_key col1
1 2
2 2
3 2
4 3
table2: pri_key(col1) col2
1 0
2 3
3 1
4 0
p/s:sorry for the bad english