I have a list of customers, and a bunch of them are duplicates (‘Acme Inc’, ‘Acme, Inc’, ‘Acme Inc.’, ‘Acme, Inc.’) They all have different IDs. BUT, each ID also has multiple addresses. Something like… I have a function that normalizes the name so the first 6 would all be ‘Acme’ and the last two ‘Plumbers’. What I want is
Tag: duplicates
Is there a way to include a DELETE FROM statement in a nested WITH statement?
I am trying to delete duplicates by creating another table but I am unable to include the delete from statement. I have the code here in SQL Server but I am trying to convert it to Oracle. I tried replacing the select with the delete from but I’m getting the error: missing SELECT keyword. Here is the code: Here is
How to update several tables with a result query?
I am working with SQL Server 2017, and I need to clean up duplicate rows and update all rows in other tables that contain my field. I’ve got one table which contains my customers Then I have 7 tables that contains the userid column and 1 table with another name column My other tables: I want to clean the duplicates
Remove duplicates with least row ids from Oracle
I have a database table which looks like ID Book_no Book_name Book_category ID1 1 B1 CB1 ID1 2 B1 CB1 ID1 3 B2 CB1 ID1 4 B2 CB1 ID1 5 B3 CB1 ID2 1 B1 CB2 ID2 2 B1 CB2 ID2 3 B2 CB2 And the expected result is like ID Book_No Book_name Book_category ID1 2 B1 CB1 ID1 4
Deleting massive number of duplicate records without using a new table
Right now I have a table that has a massive number of duplicates that need to be deleted (about 500 million). I have a query that will delete all the duplicates, but it is unable to finish the whole query due to the transaction log being filled up. Moving the nonduplicates to a new table, then renaming it, would work,
Input selected row and ignore duplicate row
I have a problem that I need to insert a selected row from the table to another table based on last_update data or last_transaction_product. last_update is the data updated from the table, and last_transaction_product is the latest transaction from my shop, and then my row has duplicate data but has a different last_update column here, this duplicate data must not
Select most recent record (with expiration date)
Let’s say that we have 2 tables named Records and Opportunities: Records: RecordID CustomerID CreateDate 777 1 1/1/2021 888 2 1/1/2021 999 1 2/1/2021 Opportunities: OppID CustomerID OppCreateDate 10 1 12/31/2020 11 1 1/10/2021 12 2 2/1/2021 13 1 4/1/2021 14 1 8/5/2025 Desired Output: RecordID CustomerID CreateDate #Opportunities 777 1 1/1/2021 1 888 2 1/1/2021 1 999 1 2/1/2021
Optimizing MySQL-Query for removing duplicates and adjusting foreign key references
i have following tables:address_table and customer_address_table The address table stores addresses and the customer_address table stores the relation between customer and address. A customer can have multiple addresses, therefore the second table. In the address table there are duplicate rows (different id but same location) and there is an address_id reference for each address in the customer_address table, so each
Detect duplicate JSON nodes in JSON parameter before insert in SQL Server table
I want to detect duplicate nodes from JSON before insert them in SQL Server table. I have this stored procedure that takes a JSON parameter like this: I want to return exception if @SalaryItems has duplicate key How can I detect duplicate in this table in my code? Answer Use OPENJSON() without a with clause so that it returns the
How to drop duplicate rows from postgresql sql table
I have the following dataset in a postgresql table called testtable in testdb. I have accidentally copied over the database and duplicated rows. How can I delete the duplicates? Row 1 and row 5 are copies in this frame and row 2 and row 4 are copies too. I have never used sql before to drop duplicates I have no