删除空行
问题描述:
我使用 PostgreSQL 数据库,并且在一张表中我有日期时间列 edit_user.有些行是空白的,我想删除这些行.
I use PostgreSQL database and in one table I have the datetime column edit_user. Some rows are blank, and these rows I would like to delete.
我试过了
DELETE FROM table WHERE edit_user="";
但是我得到了错误
LINE 1: 从表中删除 edit_user="";
LINE 1: delete from table where edit_user="";
另外,我认为列中的空白值可能是 0000-00-00,但事实并非如此.
Also, I thought in the column as a blank value could be 0000-00-00, but there isn't.
我应该如何正确执行这个命令?
How I should execute this command correctly?
答
DELETE FROM table WHERE edit_user IS NULL;