MySql 8
I have this table
:
id | name | count |
---|---|---|
1 | name1 | 3 |
2 | name2 | 4 |
I'm looking for a way to increment count
each time I get the count value.
Something like:
SELECT count FROM table WHERE id = 1 AND /*increase count value*/;
So this request will return: 3
Then if I do:
SELECT * FROM table;
I got:
id | name | count |
---|---|---|
1 | name1 | 4 |
2 | name2 | 4 |
I'm assuming I have to use an Index but I can't figure out how.
Thank you