I have a database full of simple note data, with columns for name, date, priority and details. There is also a column _id PRIMARY KEY int.
Let's say I have a note in the table with some data already filled in, and the rest with zeros. I also have a dataset that will populate all of these fields.
Is there a way so that I can only write data to NULL fields?
I cannot overwrite existing data, but I would like to add data to NULL columns.
I know the row row of the target row.
If my target row had a rowId of 5, I could do something like this:
UPDATE SET duedate='some date', priority='2', details='some text' WHERE _id=5
But this will overwrite all the data in this line, and I do not want to lose any data that may be there. How can I change this statement to avoid writing to nonzero fields?
source
share