3,133 questions
0
votes
2
answers
175
views
How to remove duplicate values that are NOT within a range from a MariaDB table?
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,
...
-1
votes
1
answer
99
views
DELETE large amounts of data in TRANSACT SQL
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 ...
0
votes
0
answers
18
views
Does NHibernate require bidirectional mappings for cascade delete?
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 ...
-1
votes
1
answer
55
views
How to reference the primary key to delete records based on the results of a select query using a composite primary key
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 ...
4
votes
1
answer
211
views
Unable to delete items using Supabase Go client
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 ...
0
votes
1
answer
85
views
Spring boot SQL error in deleting record with not-null constraint violation
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....
3
votes
1
answer
105
views
How do I DELETE with WHERE and IN using a composite primary key?
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]...
3
votes
2
answers
116
views
Why is DELETE FROM vehicle_data WHERE NOW() > expires_at; failing in my stored function?
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 ...
0
votes
1
answer
52
views
Duplicate Key violation unique constraint PostgreSQL History Tables
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. ...
1
vote
1
answer
104
views
SQL Server Deadlock Delete Insert Statement
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 ...
2
votes
1
answer
60
views
different deleting OUTPUT behaviour based on source table
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 ...
0
votes
2
answers
93
views
Python SQL executemany DELETE statement runs successfully without error for no matching records found
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 ...
0
votes
1
answer
255
views
DataStage Oracle Connector doesn't execute 'After SQL statement'
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 ...
0
votes
2
answers
185
views
Delete / overwrite rows of data based on Matched Keys in Spark
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 ...
0
votes
1
answer
63
views
oracle - index rebuild after DML operation
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)
...