mysql - Stored procedure - Update Query -


i not familiar sql stored procedure.

i have 1 table called customer , has 1 feild called accountno. want update customer table new accountno , accountno should increment 1000.

i want update customers in table , accountno 100,1001,1002.....

thanks in advance, nimmy

this update every customer in table

update customer set accountnumber = accountnumber+1000 

that's based on fact said "the customer table has 1 field - accountnumber". however, suspect table has key represents customerid (if not, should!!!)

in case want update one specific customer's account number

update customer set accountnumber = accountnumber+1000 customerid = 123 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -