Others answered your question, but ideally you would not have saved your data.
This table will be better:
id op value 330 1 0 330 2 0 330 3 1 331 1 1 331 2 0 331 3 0 332 1 3 332 2 2 332 3 0
Then you can get the amount for the ID with a simpler request:
SELECT COUNT(*) AS T FROM table WHERE id = x AND VALUE > 0
It also scales better if you decide to add additional parameters and provide an easier way to query data about specific parameter values.
source share