Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
3 replies
88 views

I'm using a table of approximately 1TB in a MySQL database. This table also has a monthly partition. We store the last two months of data in this table and regularly truncate the data from the ...
user1592429's user avatar
1 vote
5 answers
102 views

I use Postgres on my web server in order to record incoming queries into a table calls2, basically writing a single row each time with lots of repeating information, such as a date field ("when&...
Thomas Tempelmann's user avatar
0 votes
2 answers
179 views

I have a MariaDB table like this: CREATE TABLE metric_value ( id int(10) unsigned NOT NULL AUTO_INCREMENT, metric_id int(10) unsigned DEFAULT NULL, value decimal(17,2) unsigned NOT NULL, ...
planetp's user avatar
  • 16.6k
-1 votes
1 answer
104 views

I have an Excel file with approximately 300k records and I want to delete these rows from a SQL Server table. I tried using INSERT for each record but that takes way too long. I also tried to create a ...
Breezeicti's user avatar
0 votes
0 answers
24 views

If I have a very common shared table (ie. names) with a primary key (ie. name_id) included in many other tables as foreign keys, do I need my common table (names) to have a mapping reference to every ...
SofaKng's user avatar
  • 1,107
-1 votes
1 answer
58 views

Table_1 has a composite primary key: col_1, col_2. I find records that meet a certain criteria: select col_1, col_2 from thisTable where col_3 = 'criteria' Now I need to delete the records returned ...
Edwin Mercado's user avatar
4 votes
1 answer
236 views

I'm developing a REST API with Go and Gin framework that connects to Supabase. I've successfully implemented GET, POST, and PUT operations, but I'm having issues with the DELETE operation. What I've ...
Ryo Matsuzaka's user avatar
0 votes
1 answer
98 views

In Spring boot I have two entity classes import java.time.OffsetDateTime; import java.util.Set; import java.util.UUID; import jakarta.persistence.*; import lombok.*; import org.apache.commons.lang3....
Gianni Spear's user avatar
  • 8,058
3 votes
1 answer
110 views

My table: create table x( name text, group integer, primary key(name, group) ) I want to delete from it by primary key: delete from x where primary key in (["a", 1], ["a", 2]...
Alex's user avatar
  • 66.6k
3 votes
2 answers
120 views

I have prepared a DB Fiddle for my question and I will also show my complete code below - I am trying to store data in a vehicle_data table and each data record has an expires_at column: -- Create ...
Alexander Farber's user avatar
0 votes
1 answer
63 views

I have table_1 and table_1_history in PostgreSQL. I have setup a trigger for insert, update, delete on table_1. So any changes in table_1 will reflect to table_1_history and will create a new row. ...
Sachin's user avatar
  • 65
1 vote
1 answer
109 views

Both a delete and insert (range) on the same table are causing a deadlock due to contention on the same primary key index. I don't understand why. The locks taken are RangeS-S by each process and the ...
HAA's user avatar
  • 65
2 votes
1 answer
67 views

What I'm trying to achieve is a combined merge statement, that updates/deletes/moves data based on related metadata, somewhat like the following (MWS at the end): merge #data as target using #metadata ...
Johnny's user avatar
  • 45
0 votes
2 answers
97 views

I have a file which has 100 of records to get deleted from a table. I'm using cx_oracle connect connection with executemany statement from Python to Oracle SQL and trying to delete the entire 100 ...
Karthik's user avatar
0 votes
1 answer
274 views

I have a problem with an Oracle Connector. It should work as follows: 1 - Delete rows where the start date is equal to SYSDATE 2 - Insert data in that table 3 - Update rows with start date different ...
ennezetaqu's user avatar
0 votes
2 answers
203 views

I have 2 tables within Lake Database in Synapse (Parquet). It is running in Spark. 1 table with 10 billion rows (tableA) and the other 10 million rows (tableB). I want to delete the 10 mill rows from ...
Dan Wang's user avatar
0 votes
1 answer
70 views

I have a table with primary key on one column and another column with non unique index. Table volumetric is around 2 mil records. No partitions in place. delete some records (20% of data volume) ...
Mathew Linton's user avatar
-5 votes
1 answer
56 views

I want to delete the duplicate rows from a table nashvillehousing. But when I try to use a CTE and delete the duplicate rows it isnt working and I get "relation cte doesnot exist",SQL state: ...
pooja's user avatar
  • 1
0 votes
2 answers
152 views

This is my table: I need to delete those records where there is NL46 ShopCode, but only if the ProductCode has ShopCode 'FR43','FR44' or 'FR45'. I only need to keep the rows with NL46 if these ...
RebeccaJohnson's user avatar
0 votes
1 answer
168 views

I got a table in an ERP system where lot of old data resides. I got a job which detects and deletes that outdated data. However, some of that data is locked by the ERP system and therefore cannot be ...
Stefan's user avatar
  • 9
1 vote
0 answers
429 views

I am using MariaDB 10.11 on Linux. I have the following table that is supposed to get about 40 inserts per second and about 40 deletes per second. It contains trade data and is used to generate stock ...
Segolene's user avatar
0 votes
3 answers
78 views

I created this little stored procedure that deletes a row from my 'qrcode' table. Due to the constraint, I update all child rows before, it works fine. However, performing this procedure....deletes ...
Chrstpsln's user avatar
  • 777
0 votes
1 answer
2k views

We are getting an error while trying to delete a record in an Apex class. I have gone through some research for this error (listed below). However, these examples talk about this error while doing an ...
Imtiyaz's user avatar
0 votes
0 answers
39 views

I need help when clicking on my icon the corresponding message deletes it I can't get my route to work on the front side mon code front const handleTrash = (id) => { fetch(`http://localhost:...
Ines Latrache's user avatar
0 votes
1 answer
100 views

The metadata table of Spring Batch will not be automatically cleaned, so I tried to clean it manually (provided that other batches processes are executed normally during the cleaning process). When I ...
mingqingY's user avatar
1 vote
1 answer
678 views

In PostgreSQL I have to fetch ids in small batches and delete them at same time, so that no 2 clients will fetch same ids. Sadly, DELETE does not support LIMIT, so I came up with this query: DELETE ...
xakepp35's user avatar
  • 3,342
-1 votes
1 answer
53 views

I have a main table and a secondary one. Through a query I connect the secondary with the primary on the left, to filter the results of the primary. PhpMyAdmin disables editing and deleting the ...
CNV's user avatar
  • 19
-1 votes
2 answers
34 views

I am using this query to show all the departments and their managers, including the departemnts with no managers, that's why I am using left join. Now I need to delete the departements where there is ...
HugoOchoaLP's user avatar
0 votes
1 answer
147 views

We're having a rather complex table structure in our Spring Boot application, consisting of about ten entities linked by one-to-one, one-to-many, many-to-one and many-to-many relations. They're ...
ahuemmer's user avatar
  • 2,137
-2 votes
1 answer
53 views

I have a form and I connected with MySQL, so whenever I fill it up it will be shown in mySQL. The next step is to have a table of contents in my index.php, which I have. But now when I wanna press the ...
Hollyy's user avatar
  • 1
1 vote
1 answer
218 views

I have two master-detail tables with a one-to-many relationship. I want to let a trigger fire after a deletion has happened, whether it has been as a cascade action (deleting the master by its PK) or ...
ImproveSoftware's user avatar
1 vote
1 answer
48 views

I have two tables to handle attachments: "files" which contains an id and other info "attachments" which contains the id_file (the id in the table files is the foreign key) and ...
djcaesar9114's user avatar
  • 2,147
0 votes
1 answer
98 views

Let's say we have a table: CREATE TABLE rows( a int NOT NULL, b int, c int ); INSERT INTO rows(a, b, c) VALUES (1, 1, NULL), (2, NULL, 1), (3, 1, 1); Why Postgres does not delete the row using ...
Ilya Ordin's user avatar
0 votes
0 answers
28 views

In a timesheet system, there is the charge tree where we enter projects for employees to add to the timesheet. We are wanting to start cleaning this up on old projects that have ended, etc. This is ...
Mimi9864's user avatar
0 votes
0 answers
33 views

We are using MySQL where we have almost around 100 tables. Data in these tables grow with time. So we need to delete the older data periodically. I think there are two approaches for this. First is to ...
Suparn Lele's user avatar
1 vote
1 answer
71 views

I'm trying to figure out a way to check for the count of records in a table, and: if it's equal to 1, then just delete that one record, if it's greater than 1, then delete all except the latest ...
Mike K's user avatar
  • 6,625
0 votes
1 answer
540 views

I'm just starting with Apex, I just need to link a delete button to the checkbox in an interactive report, in order to delete the selected raws. This is the report source (SQL query): select ...
Matteo Congiu's user avatar
1 vote
1 answer
204 views

I have a SAP HANA SQL query with two Common CTE's and followed by delete SQL on a regular Table. The SQL execution fails with incorrect syntax. Below is the error code and the HANA SQl script. WITH ...
vams's user avatar
  • 11
0 votes
0 answers
47 views

id name Createdat Updatedat flag 1 A 25-12-2023 01:11:15 true 2 B 24-12-2023 12:12:12 25-12-2023 14:14:14 false I am having table like above. I am getting set of ids along with other details as a ...
krishna raja's user avatar
0 votes
2 answers
124 views

I've got a table that has duplicate data that needs to be cleaned up. Consider the following example: CREATE TABLE #StackOverFlow ( [ctrc_num] int, [Ctrc_name] varchar(6), [docu] bit, ...
kool_kris's user avatar
0 votes
1 answer
64 views

I want create a function which removes rows and returns true if there are no errors: CREATE OR REPLACE FUNCTION s_grnplm_tt.sp_del_stts_cd(num text, package_name text, stts_cd text) returns ...
John Stendreen's user avatar
-1 votes
1 answer
126 views

delete from dupp where empno in (select empno,count() from dupp group by empno having count()>1) Error Code: 1241. Operand should contain 1 column(s) what can i do to slove this ??/ i want to ...
maxe magesh's user avatar
0 votes
1 answer
1k views

I'm trying to remove about 50 milliong of 40 billions rows table (one specific day based on event_date column) , I'm using lightweight delete with "where" clause and "where" has no ...
Alexandr  's user avatar
1 vote
1 answer
105 views

I was using this query: DELETE T1, T2 FROM table1 T1, table2 T2 It seems to work inconsistency in mysql. If both tables contain rows, then all row in each are deleted, as I expected. But if one table ...
A Harrison's user avatar
0 votes
2 answers
1k views

I ran a simple delete query on a telemetries table to clear up some data but cancelled as it was taking really long. I noticed that after I cancelled the query some of the tables (all partitions of ...
Ozymandias's user avatar
0 votes
1 answer
67 views

I have a db with multiple tables. The tables have all the same structure with one column called date and a bunch of other columns with various data. I can remove the duplicates from a single table as ...
Hotone's user avatar
  • 453
1 vote
0 answers
53 views

My delete method is not working. Here the DAO: @Dao public interface TodoDAO { @Insert public void insert(Todo todo); @Delete public void delete(Todo todo); @Query("SELECT * ...
Bryan Valerio's user avatar
0 votes
1 answer
125 views

I have a function that deletes rows from many tables, as much as 130+ tables, in a loop. The problem isn't the DELETE statements themselves, they seem to complete fine in a timely fashion, but for ...
Francis Ducharme's user avatar
1 vote
1 answer
3k views

I have clustered clickhouse instance and observing following behavior: when I delete data on every node of clickhouse using for example alter table db.tb on cluster cl1 delete where event_date = ...
Alexandr  's user avatar
1 vote
1 answer
50 views

I am building a partial website with others but when I want to delete a checked item, it gives an error "Not Found The requested URL was not found on the server. If you entered the URL manually ...
Mariano's user avatar
  • 13

1
2 3 4 5
63