As you have demonstrated it I have do hard code the columns which should be updated and can't keep it dynamical.
If I have a updated table with new sequences I will also get other frequent sequences. In your solution I must adjust then the whole code for 1, 0 indication.