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
8
votes
1 answer

How can I delete an object with navigation property with entity framework 5 code first?

I'm using EF 5 code first and I have 2 related entities ApplicationPermission and Application: public class ApplicationPermission { public virtual Application Application { get; set; } public int Id { get; set; } } public class Application…
Alexey G.
  • 360
  • 7
  • 15
7
votes
2 answers

R: How can I delete rows if an element in a row satisfies certain characteristic?

I am trying to figure out a way to delete rows of matrix if a cell in that row satisfies a certain characteristic. For example: > mm <- matrix(c(1,2,3,2,3,4,1,2,3,4),5,2) > mm [,1] [,2] [1,] 1 4 [2,] 2 1 [3,] 3 2 [4,] 2 …
Akavall
  • 82,592
  • 51
  • 207
  • 251
7
votes
3 answers

UITableView callback after row deletion animation complete

I have a table with shadows above the top and below the bottom cell (using Matt Gallagher's solution here: http://cocoawithlove.com/2009/08/adding-shadow-effects-to-uitableview.html). These are added in the layoutSubviews method of the UITableView…
fezfox
  • 967
  • 9
  • 14
7
votes
1 answer

How to delete a row from a SQL table?

I have a row that needs to be deleted from a SQL table via PHP. The table has 3 columns: id, Symbol, and Shares: foreach ($rows as $row) { if($row["Symbol"] === $_POST["symbol"]) { // I tried these combinations, but none of them works: …
user3706178
  • 125
  • 1
  • 2
  • 6
7
votes
2 answers

How to remove a row from a CSV with Ruby

Given the following CSV file, how would you remove all rows that contain the word 'true' in the column 'foo'? Date,foo,bar 2014/10/31,true,derp 2014/10/31,false,derp I have a working solution, however it requires making a secondary CSV object…
spuder
  • 17,437
  • 19
  • 87
  • 153
7
votes
2 answers

Delete limited n rows from oracle sql table

I want to delete exactly 2 rows/records for each employee that is working in more than 3 projects. Let's say I have this table: +----------+-------------+ | employee | Project | +----------+-------------+ | 1 | p1 | | 1 | …
Youssef Khloufi
  • 685
  • 3
  • 13
  • 24
7
votes
2 answers

The most efficient way to delete all duplicate rows from table?

I have a table: | foo | bar | +-----+-----+ | a | abc | | b | def | | c | ghi | | d | jkl | | a | mno | | e | pqr | | c | stu | | f | vwx | I want to delete all rows containing duplicates by foo column so that the table should look…
6
votes
3 answers

DELETE + JOIN + ORDER BY + LIMIT = syntax error

Drop the ORDER BY + LIMIT, or the JOIN, and everything is peaches. Put them together and I seem to release the Kraken. Anyone who can shed some light? DELETE table1 AS t1 FROM table1 AS t1 LEFT JOIN table2 AS t2 ON t1.id = t2.id WHERE t2.field =…
TheDeadMedic
  • 9,948
  • 2
  • 35
  • 50
6
votes
5 answers

How do I remove a row from recyclerview using room?

I'm trying to delete an row of recyclerview using room.im doing swipe to delete a particular row.... Here is my Address table--> @Entity(tableName = "address") class Address { @PrimaryKey(autoGenerate = true) var id = 0 @ColumnInfo(name =…
6
votes
3 answers

How to delete rows for leading and trailing NAs by group in R

I need to delete rows containing NA, but only if they are leading(trailing) i.e. before(after) any data appears for a variable. This is very similar to: How to find (not replace) leading NAs, gaps, and final NAs in data.table columns by…
Juan
  • 171
  • 1
  • 12
6
votes
4 answers

R - delete consecutive (ONLY) duplicates

I need to eliminate rows from a data frame based on the repetition of values in a given column, but only those that are consecutive. For example, for the following data frame: df = data.frame(x=c(1,1,1,2,2,4,2,2,1)) df$y <-…
ebb
  • 274
  • 2
  • 6
  • 16
6
votes
2 answers

Deleting rows in PostgreSQL if column begins with a specific pattern

I am very new at PostgreSQL and want to be able to delete rows from a table if a specific column starts with a certain pattern. For example, I have a reference column which is a sort of time stamp (YYMMDDHHMM). If the reference column starts with…
sym246
  • 1,836
  • 3
  • 24
  • 50
6
votes
3 answers

How to delete a contact?

I'm working at android 2.1 ContactContract, when I had not set account(for example: gmail account) to android emulator then, new a contact, but could not delete this contact at DB. ArrayList ops = new…
user408273
  • 133
  • 1
  • 8
6
votes
4 answers

Delete records within Instead Of Delete trigger

I want to have an instead of delete trigger so that I can get text field values out of the table row that's being deleted to preserve those fields when the actual delete occurs. For some reason I can't pull them from the Deleted table in a standard…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
6
votes
2 answers

Deleting rows in R conditionally

I have a data where the first column is a bunch of ID numbers (some repeat), and the second column is just a bunch of numbers. I need a way to keep each ID number only once based on the smallest number in the second column. Row# ID Number 1 …
Swanny
  • 189
  • 1
  • 12