Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete empty rows

Tags:

sql

postgresql

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.

I tried

DELETE FROM table WHERE edit_user=""; 

but I got the error

LINE 1: delete from table where edit_user="";

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?

like image 837
user984621 Avatar asked May 18 '12 14:05

user984621


People also ask

How do I get rid of infinite blank rows?

Go to Home tab -> Delete. Select Delete Sheet Rows. The blank rows will be deleted.

How do I bulk delete rows?

To delete multiple rows into your worksheet, select the rows you wish to delete by clicking on the row header and dragging down to the header of the last row you wish to delete. Right-click on the row header and select Delete. In the Ribbon, select Home > Cells > Delete > Delete Sheet Rows.


1 Answers

DELETE FROM table WHERE edit_user IS NULL; 
like image 122
Phil Avatar answered Sep 21 '22 18:09

Phil