I'm trying to update a field nr in the database:
I have: Example data…
table ring
ID ri mr nr
1 a 0
2 a b 0
3 a c 0
4 d 0
5 b e 0
6 e f 0
I need a query that gives this result to sum where sum count how many times value from mr apear in ri and update nr whit this value
Result shoud be like this
ID ri mr nr
1 a 2
2 a b 1
3 a c 0
4 d 0
5 b e 1
6 e f 0