In the database structured query language (SQL), the DELETE statement removes one or more records from a table.
1
vote
2answers
52 views
Approaches for deleting unnecessary records from tables
We have a database which stores the temperatures of 20 thermometer every 7 seconds. We want to delete all records in the way that every minute holds just one tempereature instead of 8 which are older ...
0
votes
1answer
34 views
Need ideas about OPTIMIZE TABLE
Looking at a database with 10 tables and fairly active at by-the-hour changes. On the first of each month, I purge some rows from 3 tables to remove outdated material and keep the size down. All of ...
1
vote
1answer
82 views
Delete entry from related tables
I can not use InnoDB engine because of some dependency troubles in LuaSQL and PtokaX.
My current query is something like:
DELETE e.*, m.*
FROM `entries` e
INNER JOIN `magnets` m
ON ...
2
votes
4answers
131 views
Delete the N oldest entries grouped by multiple columns
I´d like to delete the oldest entries of my database, but in each category shall remain at least N words of each char.
Structure of TABLE words
id | word | char | category
For example I have the ...
1
vote
1answer
56 views
Will deleting data in master automatically delete data in slave?
I have data replication setup on MySQL. If I delete data on the master, will replication know data was deleted and automatically delete the same data on slave?
0
votes
2answers
101 views
Fastest way to delete matching rows in MySQL?
I have more than 10 million records in a table. I want to delete the
records where the email column contains .ac..
What is the fastest method to perform the task?
Table Schema
CREATE TABLE `master` ...
1
vote
1answer
181 views
Very slow DELETE in PostgreSQL, workaround?
I have a database on PostgreSQL 9.2 that has a main schema with around 70 tables and a variable number of identically structured per-client schemas of 30 tables each. The client schemas have foreign ...
3
votes
1answer
129 views
Why is truncate DDL?
I have an interview question, which being asked during my interview. I answered the question, but interviewer was not convinced with my answer. So, please let me know the what would be the correct ...
2
votes
0answers
40 views
What is the equivalent of a “Certificate of Destruction” when using a cloud-hosted database?
We have a Rails application hosted by Heroku and using an Heroku Postgres database. Some of the information we store is considered to be sensitive by our users, and we've been asked if we can provide ...
1
vote
1answer
167 views
mysql query - how to delete duplicates based on highest int?
I'm running a reverse auction website and I need to delete the duplicate bids and keep only the highest amount . lastPriceBid_rounded is the "amount". The duplicate is defined by the userId.
...
1
vote
1answer
54 views
Mysql setting a record as deleted or archive
Is there any way to omit some records in mysql select statement and not deleting them? We can easily add a column for example deleted and set it to 1 for deleted ones and keep them but the problem is ...
2
votes
1answer
210 views
Most efficient way of bulk deleting rows from postgres
I'm wondering what the most efficient way would be to delete large numbers of rows from PostgreSQL, this process would be part of a recurring task every day to bulk import data (a delta of insertions ...
2
votes
2answers
97 views
Inserting data to a table which is being cleaned up by SQL job at the same time
Our app uses a table in a database and we have a Sql job set up to run overnight which executes a stored procedure which just deletes data older that from the table.
DELETE FROM
MyTable
...
1
vote
1answer
120 views
Delete word, its meanings, its meaning's example sentences from DB
I have three tables as below (simplified for demonstration):
words
=====
integer id
text word
meanings
========
integer id
integer word_id
text meaning
examples
========
integer id
integer ...
2
votes
1answer
162 views
Error deleting more than 1 row
I have a stored procedure that is supposed to delete several rows from a table. It does not work and gives me the error:
The transaction ended in the trigger. The batch has been aborted
I tried ...