mysql - sql query column value = column value - 1 -
i need -1 column on each row of table , wondering if there way sql rather writing in php?
on each row there "score" column , need -1 value on each row.
in php i'd use like
foreach ( $rows $row ){ $score = $row->score - 1; $this->update_score($score, $row->id); }
but 3000+ records update, there must better way?
thanks lot help.
update table_name set score = score - 1
Comments
Post a Comment