i understand how to use server events or expression i ust need help with the sql .
Value | Sort
76 | 0
82 | 0
7 | 0
14 | 0
the result would be:
Value | Sort
76 | 2
82 | 1
7 | 4
14 | 3
i understand how to use server events or expression i ust need help with the sql .
Value | Sort
76 | 0
82 | 0
7 | 0
14 | 0
the result would be:
Value | Sort
76 | 2
82 | 1
7 | 4
14 | 3
update table1
set sort = t.rnum
from (select table1.value, row_number() OVER (ORDER BY value desc) as rnum from table1) t;
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from (select table1.value, row_number() OVER (ORDER BY value desc) as rnum fr...' at line 3