My mysql table name is: mytable Here is the table structure (one column and values) myid ----- X1 X3 X2 X6 X6 X9 X1 X7 X5 X4 X8 How can I write one line query to update (decrease 1) all myid values where myid >= X5 So the result will look loke the following: myid ----- X1 X3 X2 X5 X5 X8 X1 X6 X4 X4 X7 I want to use it with php. Thanks in advance.
Surely you've just discovered why its better to have a normalised table? This is just a sophisticated text file IMO. Put the values in two columns, add an id column (just because). You will find it easier to concatenate then to split and add/subtract.