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
Post a Comment