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
5
votes
5 answers

How do I delete all the rows of a table with a recursive structure (MySQL)?

I have a table in my DB, in which every row has a parent id which is the id of another row in the table (the table represents a tree-like structure). I would like to empty the table. But when I perform DELETE FROM table_name WHERE true; I get an…
snakile
  • 52,936
  • 62
  • 169
  • 241
5
votes
3 answers

How to resolve error 400 in excel-vba

I am writing an excel-vba to find and delete entire row if having blanks cell in a particular column. My macro is working fine if there is at least one blank cell but showing error 400 if there is no blank cell. My code is Sub GPF_Sign() Dim i As…
Abhinn Wasav
  • 145
  • 1
  • 5
  • 13
5
votes
1 answer

PostgreSQL: Delete all but most recent date

I have a table defined like so: CREATE TABLE contracts ( ContractID TEXT DEFAULT NULL, ContractName TEXT DEFAULT NULL, ContractEndDate TIMESTAMP WITHOUT TIME ZONE, ContractPOC TEXT DEFAULT NULL ); In this table, a ContractID may have more…
Michael Sheaver
  • 2,059
  • 5
  • 25
  • 38
5
votes
1 answer

How can I delete records from an ODBC database based on a dataframe in R

I have a dataframe in R that has a list of records. I would like to delete all of the matching records from my ODBC datasource. data_to_delete ##This is my dataframe delete from RODBC datasource where record_id IN (select record_id …
rascale
  • 79
  • 1
  • 6
5
votes
1 answer

sailsjs delete/update multiple rows

I am working on sailsjs, I have generated api model and controller. I am just wondering if I can post and create many entries of this model instead of use curl in commandline over and over. also does this restful interface support a delete method…
Evilsanta
  • 1,032
  • 11
  • 18
5
votes
3 answers

Cannot delete row from MySQL

I've got a table, which won't delete a row. Specifically, when I try to delete any row with a GEO_SHAPE_ID over 150000000 it simply does not disappear from the DB. I have tried: SQLyog to erase it. DELETE FROM TABLE WHERE GEO_SHAPE_ID = 150000042…
Drew
  • 1,687
  • 5
  • 25
  • 46
5
votes
2 answers

How to pop up a dialog to confirm delete when user long press on the list item?

I am learning from a online tutorial, and i try to implement some function by my own. How can i pop up a dialog to alert user when detect a long press on list item? Following is some code from that tutorial: public class FriendList extends…
Chung
  • 123
  • 1
  • 1
  • 8
5
votes
4 answers

Error 400 Invalid request YII for deleting a record

I am trying to delete a record in Yii, which throws a Error 400. Please do not repeat this request again. It's checking for a post variable, my controller file has if(Yii::app()->request->isPostRequest) When I echo my post variable it's blank…
dibs_ab
  • 723
  • 2
  • 13
  • 24
4
votes
4 answers

Delete all but latest 500 rows from sqlite database

My SQL isn't bad but SQLite on iOS constantly catches me out. I have a table where I want to limit the number of rows to around 500, so when it hits a trigger point of say 550 it will delete the earliest 50 rows. It's rolling so with time the id…
JulianB
  • 1,686
  • 1
  • 19
  • 31
4
votes
4 answers

MySQL Delete duplicates in consecutive rows

Suppose this table: ID ColA ColB 1 7 8 2 7 9 3 7 9 4 5 8 5 6 9 6 6 9 7 5 4 The PK is the ID coumn. Now, I want to delete all duplicates of ColA and ColB in consecutive rows. In this example rows 2,3 and 5,6…
Juergen
  • 3,489
  • 6
  • 35
  • 59
4
votes
3 answers

How can I delete records that match a condition, leaving 50?

Consider the following table: CREATE TABLE `prize` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `prize_details_id` bigint(20) NOT NULL, `status` tinyint(4) DEFAULT '0', `available_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY…
BenLanc
  • 2,344
  • 1
  • 19
  • 24
4
votes
4 answers

Discard value=1 across entire row

Rows where all the values are 1. I wish to remove all such rows.
80907
  • 43
  • 3
4
votes
1 answer

Android sqlite delete doesn't actually delete rows

I'm using a fairly simple command to try to delete rows in a SQLite database. However, after successfully running the command, the rows remain in the DB!? SQLiteDatabase dbinst = mydb.getWritableDatabase(); try { dbinst.beginTransaction(); int…
Joel Palmius
  • 191
  • 1
  • 5
4
votes
4 answers

Oracle 10g Table size after deletion of multiple rows

As part of maintenance, we remove a considerable amount of records from one table and wish to dispose of this space for other table. The thing is that I'm checking the size of the table and it shows the same original size before the delete. What am…
danboh
  • 758
  • 2
  • 11
  • 28
4
votes
0 answers

SwiftUI Swipe to delete on list action very hard to trigger

I have a list with a ForEach that has the .ondelete function however it is very difficult to get the swipe action to work correctly (1 in 100 swipes work) and display the delete button. Once it does it all works correctly and the delete…
BlakePat
  • 75
  • 7