Questions tagged [delete-row]

Delete row refers to the removal of rows from a relational database.

The deletion can be achieved by using the DELETE statement of the SQL language.

1917 questions
70
votes
6 answers

How to get the number of deleted rows in PostgreSQL?

I am looking for a way to return the number of rows affected by a DELETE clause in PostgreSQL. The documentation states that; On successful completion, a DELETE command returns a command tag of the form DELETE count The count is the number of…
Erkan Haspulat
  • 12,032
  • 6
  • 39
  • 45
49
votes
3 answers

Delete rows that exist in another data frame?

I have the two following data frames (example): df1: name profile type strand A 4.5 1 + B 3.2 1 + C 5.5 1 + D 14.0 1 - E 45.1 1 - F 32.8 …
biohazard
  • 2,017
  • 10
  • 28
  • 41
46
votes
4 answers

DataTable, How to conditionally delete rows

I'm engaged in a C# learning process and it is going well so far. I however just now hit my first "say what?" moment. The DataTable offers random row access to its Rows collection, not only through typical collections behavior, but also through…
Alexandre Bell
  • 3,141
  • 3
  • 30
  • 43
38
votes
7 answers

Google BigQuery Delete Rows?

Anyone know of any plans to add support for delete parts of data from a table in Google Bigquery? The issue we have right now is we are using it for analytics of data points we collect over time. We want to run the queries over the last X days of…
Daum
  • 815
  • 1
  • 7
  • 11
34
votes
5 answers

Is it possible to delete from multiple tables in the same SQL statement?

It's possible to delete using join statements to qualify the set to be deleted, such as the following: DELETE J FROM Users U inner join LinkingTable J on U.id = J.U_id inner join Groups G on J.G_id = G.id WHERE G.Name = 'Whatever' and U.Name not in…
bwerks
  • 8,651
  • 14
  • 68
  • 100
30
votes
4 answers

How to delete in MS Access when using JOIN's?

I am attempting to use the DELETE clause in MS Access and have an issue when also using the JOIN clause. I have notice this can be accomplished by using the DISTINCTROW key word. For example, the following SQL statement does not allow for…
Curtis Inderwiesche
  • 4,940
  • 19
  • 60
  • 82
29
votes
11 answers

Delete blank rows from CSV?

I have a large csv file in which some rows are entirely blank. How do I use Python to delete all blank rows from the csv? After all your suggestions, this is what I have so far import csv # open input csv for reading inputCSV =…
debugged
  • 317
  • 1
  • 3
  • 8
29
votes
5 answers

How to delete current row with jquery datatable plugin

I have a column with buttons in a table I'm using jQuery datatable plugin. The buttons say "Remove" and the idea is that when you click on that button it deletes the current row in the table. When I call fnDeleteRow it seems to work the first time…
leora
  • 188,729
  • 360
  • 878
  • 1,366
26
votes
3 answers

Delete points with unwanted field values from InfluxDB measurement

InfluxDB lets you delete points based on WHERE tag='value' conditions, but not by field value. For example, if you have accidentally stored a measurement with a value of -1 in a series of positive floats (e.g. CPU utilization), DELETE FROM metrics…
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
22
votes
5 answers

In SQL, is 'FROM' in 'DELETE FROM' optional if you plan to use 'WHERE'?

I'm new to SQL. We have some code that should work on SQL Server 2005/2008, Oracle 10 as well as Sybase. I was writing a script to try to figure out which tables a given stored procedure modifies (but does not drop), e.g insert, update and…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
20
votes
3 answers

django storages aws s3 delete file from model record

I have based my django aws S3 solution on https://simpleisbetterthancomplex.com/tutorial/2017/08/01/how-to-setup-amazon-s3-in-a-django-project.html. Now I am trying to find a way to delete a row in the model that contains the S3 file. I am able to…
Axil
  • 3,606
  • 10
  • 62
  • 136
17
votes
5 answers

How do I delete blank rows in Mysql?

I do have a table with more than 100000 data elements, but there are almost 350 blank rows within. How do I delete this blank rows using phpmyadmin? Manually deleting is a tedious task.
Jose H d
  • 195
  • 1
  • 3
  • 7
16
votes
2 answers

Protect row from deletion in MySQL

I want to protect some rows from deletion and I prefer to do it using triggers rather than logic of my application. I am using MySQL database. What I came up with is this: DELIMITER $$ DROP TRIGGER `preserve_permissions`$$ USE…
BartoszCichecki
  • 2,227
  • 4
  • 28
  • 41
15
votes
1 answer

np.delete and np.s_. What's so special about np_s?

I don't really understand why regular indexing can't be used for np.delete. What makes np.s_ so special? For example with this code, used to delete the some of the rows of this array.. inlet_names = np.delete(inlet_names, np.s_[1:9], axis =…
Greg Castaldi
  • 355
  • 1
  • 4
  • 11
14
votes
6 answers

How to delete mysql row after time passes?

I have no idea where to start with this one: I have a database that stores postID and Date. What I want to do is have my website auto delete all rows where Date is less than today. This script can't have any user input at all. No button clicks,…
Sweepster
  • 1,829
  • 4
  • 27
  • 66