Answer the question
In order to leave comments, you need to log in
How to change last column in sqlite python?
I have a sqlite table and I need to change a value in it. The thing is, I have multiple rows with the same key. How can I change only the last line with the hello key?
Answer the question
In order to leave comments, you need to log in
> The fact is that I have several rows with the same key.
So you do not have a primary key in the table, since the primary key must be unique.
Correct the structure of the table so that there is a truly unique key, then there will be no such problems.
The matter is that at me some lines with the same key. How can I change only the last line with the hello key?
SELECT * FROM my_table WHERE my_key='Hello wrot' ORDER BY 'id' DESC LIMIT 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question