T
T
TheMergus2019-08-10 12:24:03
Python
TheMergus, 2019-08-10 12:24:03

How to find all rows with values ​​0 and add 1 to them?

There is a database, it has the following columns:
id - user id
amount - some number
How to find all users with amount = 0, and add 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Yakushenko, 2019-08-10
@TheMergus

execute('UPDATE table_name SET amount=1 WHERE amount=0')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question