0

How do you add +1 value by using update function?

4th Nov 2017, 2:36 PM
saad shahzad
saad shahzad - avatar
2 Respostas
+ 10
UPDATE table_name SET column_name = column_name + 1 WHERE (condition) Example: UPDATE Account SET balance = balance + 1 WHERE customer_name = 'Saad' Note: If you're talking about incrementing primary key, then there is an option called "auto-increment". Select that while creating the table.
4th Nov 2017, 3:09 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 2
thankyou yeah i do know about auto increment :D i am just not used to sql yet
4th Nov 2017, 3:18 PM
saad shahzad
saad shahzad - avatar