Find null values from table and replace it with space - sqlite

纵然是瞬间 提交于 2019-12-11 09:19:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!