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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -