From: Johan De Meersman Date: April 4 2012 10:33am Subject: Re: migrate existing data each additional product List-Archive: http://lists.mysql.com/mysql/227110 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > From: "HaidarPesebe" > > I asked for help, how to order that each time I add an item then the > item number in column 1 move to column 2, column 2 moves to the > column 3, column 3 to 4 and so on. > > product | 1 | 2 | 3 | 4 | total > [...] What a most peculiar thing to do :-) You can't have - correction: I don't think you can have column names that start with a digit, so I'll conveniently call them c1 and so on. An update statement is processed in order, so this should work: UPDATE SET c4=c3, c3=c2, c2=c1, c1=, total=c1+c2+c3+c4 WHERE ; I would strongly question whether there's no better way to design whatever you're doing, though. /johan -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel