Sto tendando di fare un update che inserisca una sorta dl classifica nella tabella ranking in base ai points. Sono ben accetti altri metodi, perche questo mi da errore e non so come risolverlo.
tabella ranking
Querycodice:+----+------+--------+ | id | rank | points | +----+------+--------+ | 2 | 2 | 20 | +----+------+--------+ | 3 | 1 | 45 | +----+------+--------+ | 4 | 3 | 10 | +----+------+--------+
L'errore che mi da phpmyadmincodice:SET @r=0; UPDATE ranking SET rank=@r:=(@r+1) ORDER BY points DESC
codice:SET @r=0;# MySQL ha restituito un insieme vuoto (i.e. zero righe). UPDATE ranking SET rank=@r:=(@r+1) ORDER BY points DESC# MySQL ha restituito un insieme vuoto (i.e. zero righe).
Nota: id e' una primary key autoincrement.
La query funziona ma mi da errore.
Ho fatto un cron-job che mi restituisce una mail di errore ogni volta che esegue la query



Rispondi quotando
