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
6
votes
3 answers

Datagridview, disable button/row

I have a datagridview on a form with some data. The 1st column contains button for deleting the row. How can we disable this button or the entire row based on some condition, so the row cannot be deleted?
SoftwareGeek
  • 15,234
  • 19
  • 61
  • 78
6
votes
3 answers

Delete from multiple tables (linq to sql)

I'm using Linq to SQL to access my database. I want to have a 'delete account' feature which basically gets rid of all records in all tables that belong to a given user. What would be the most efficient way of doing this? The deletion has to occur…
o-logn
  • 500
  • 1
  • 10
  • 21
6
votes
3 answers

MySQL delete row from multiple tables

Is this the correct way to do it? DELETE t1, t2, t3, t4 FROM table1 as t1 INNER JOIN table2 as t2 on t1.id = t2.id INNER JOIN table3 as t3 on t1.id=t3.id INNER JOIN table4 as t4 on t1.id=t4.id WHERE t1.username='%s' AND t1.id='%s'
salmane
  • 4,799
  • 13
  • 48
  • 61
6
votes
1 answer

Delete rows in data frame if entry appears fewer than x times

I have the following data frame, call it df, which is a data frame consisting in three vectors: "Name," "Age," and "ZipCode." df= Name Age ZipCode 1 Joe 16 60559 2 Jim 20 60637 3 Bob 64 94127 4 Joe 23 94122 5 Bob 45 …
Mon
  • 251
  • 1
  • 3
  • 9
6
votes
2 answers

How does deleting rows from a table affect its indexes?

Is it better, for indexing in the long run, to delete or "deactivate" rows, or under what circumstances? I notice overhead generated after deleting a significant number of rows from a table. Why does this occur and what can be done 1) to prevent it…
reformed
  • 4,505
  • 11
  • 62
  • 88
6
votes
3 answers

DELETE FROM ... reporting syntax error at or near "."

I'm trying to delete just one data from my DB, but, when I write the command I keep getting that there's some syntax error, could you tell me where is the error? This are the commands I've tried: DELETE FROM database_userprofile WHERE user.username…
Sascuash
  • 3,661
  • 10
  • 46
  • 65
6
votes
4 answers

How to delete rows using CTE and INNER JOIN?

How can I delete data from a table using CTE and INNER JOIN? Is this valid syntax, so should this work: with my_cte as ( select distinct var1, var2 from table_a ) delete from table_b b inner join my_cte on var1 = b.datecol and var2 = b.mycol;
Matkrupp
  • 781
  • 5
  • 12
  • 17
6
votes
5 answers

Deleting records from SQL Server table without cursor

I am trying to selectively delete records from a SQL Server 2005 table without looping through a cursor. The table can contain many records (sometimes > 500,000) so looping is too slow. Data: ID, UnitID, Day, Interval, Amount 1 100 10 21 …
Ian Hockaday
5
votes
2 answers

Android : How to Refresh list upon item deletion in customized SimpleAdapter

May i know how to refresh the ListView item after i have remove a map list item in customized SimpleAdapter ? I have successfully implement the delete list item with list.remove(position), but when I have tried to called list.notifyAll() function…
johnteow
  • 53
  • 1
  • 5
5
votes
1 answer

Delete a row from Zend_Db_Table using JOIN

I need to delete a record using Zend_Db_Table referencing the rence table. In SQL the query would look like this: DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL; Is there a way to do this more elegant than the code below? $table…
Minras
  • 4,136
  • 4
  • 18
  • 18
5
votes
3 answers

Show all rows in mysql table then give option to delete specific ones

I want to have the ability to show all the entries in a database table and by each one give the user the ability to delete specific ones. I am currently using a for each loop that loops through the database showcasing each entry. $result =…
DIM3NSION
  • 1,681
  • 5
  • 20
  • 38
5
votes
1 answer

How to delete duplicate rows in SQL ( Clickhouse)?

so I created a table using clickhouse, but it has duplicates in it. The following query gives me the duplicates in my table select *, count() AS cnt from my_table GROUP BY * HAVING cnt > 1 In clickhouse apparently you need do this through…
Dude
  • 366
  • 5
  • 19
5
votes
1 answer

deleting document from cosmos db using C# and cosmos client

I am new to Cosmos DB and after reading through the microsoft docs am attempting to delete records from a cosmos db. I have tried to follow the example as closely as possible. The record is being found and read but I am running into a not found…
Jai
  • 155
  • 2
  • 9
5
votes
1 answer

remove R Dataframe rows based on zero values in one column

I have this dataframe with a set of zero values along two columns. df Sl_No No_of_Mails No_of_Responses 1 10 2 2 0 0 3 20 0 4 10 10 5 0 0 6 0 …
Raghavan vmvs
  • 1,213
  • 1
  • 10
  • 29
5
votes
2 answers

Making only some rows deletable in a UITableView [Swift 3.0 - Xcode 8]

I have an array fruit = ["Apple", "Orange", "Pear", "Kiwi"] that has Entity FOOD and is presented in an UItableView. Is there a way to make some content undeletable. For example, can I make "Kiwi" undeletable. Something like, let i =…
Dan.code
  • 431
  • 2
  • 14