问题
I am having sqlite database.
In some columns I am having null values.
I want to replace null values with space..
Is there any query for this?
Please let me know
回答1:
Use IFNULL. In a query:
SELECT IFNULL(mycolumn, ' ') FROM mytable
Or to change the data in the table:
UPDATE mytable SET mycolumn = IFNULL(mycolumn, ' ')
Alternatively:
UPDATE mytable SET mycolumn = ' ' WHERE mycolumn IS NULL
来源:https://stackoverflow.com/questions/12585560/find-null-values-from-table-and-replace-it-with-space-sqlite