Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The Duplication tag covers the topic of duplicated data and the strategies involved in removing the duplicates, often referred to as deduplication or simply dedupe.

-2
votes
0answers
34 views

Eleminate Duplicate Records [closed]

Doing an internal project to read machine data and write into SQL Server. Machine generate multiple data string of duplicate record in each second; I want to record data into table when there is ...
0
votes
2answers
55 views

Remove Duplicates (or Select Unique) from multiple rows, with all random data

I have a table that gets results from three different sources. Each column represents a source, and each row a result of an outcome. There are over 50k rows for a total of 150k results. I need to ...
2
votes
2answers
63 views

Ignore duplicates while using join

I'm trying to ignore duplicates between two providers in my tables while using join. I'm using this query for now: SELECT * FROM A AS a1, A AS a2 WHERE a1.provider <> a2.provider AND a1.etype =...
2
votes
2answers
42 views

Duplicate index - Same key, one with INCLUDE columns, which one to drop?

I have 2 indexes that have the same key, but one also has INCLUDE columns. Which one can I drop? They are the same, except IndexInclude has 6 INCLUDE columns. Both have some reads (IndexNoInclude ...
-1
votes
1answer
30 views

eliminating duplicates

I want to pull users that only have ONE deviceID in a given month. Let's say I have the following table: User Device ID Greg 1 Greg 2 Mike 3 Laura 4 Laura 5 Lisa 6 George 7 Peter ...
1
vote
1answer
34 views

Delete duplicates and reroute referencing rows to new master

Given three tables: A users table with id's: ╔════╗ ║ id ║ ╠════╣ ║ 1 ║ ╟────╢ ║ 2 ║ ╟────╢ ║ 3 ║ ╚════╝ A purposes table with user_id's and name's: ╔════╤═════════╤══════════╗ ║ id │ user_id │ ...
0
votes
2answers
43 views

How to delete records without a primary key in a stardard way (i.e. not using ctid)

Case of use We have a log table without a PK with two columns (date, event); You inserted a row. Then you want to undo the inserted record. Is there a way to delete that row (without deleting ...
1
vote
2answers
99 views

Insert into Table ignoring duplicate values

I am having a brain fart on figuring this out. I have the following two Tables: Table: parts part_id INT IDENTITY(1,1) NOT NULL, part_number VARCHAR(50) UNIQUE NOT NULL, ...
0
votes
1answer
98 views

oracle sql: How to not select select duplicate records from table

Can any help me to fix the below sql query SELECT DISTINCT ORDER_NUMBER, FLAG FROM TABLE Below was the result Order_number FLAG LP-13288 false LP-13288 true LP-13292 false LP-13290 ...
0
votes
0answers
31 views

Weird MySQL behavior - duplicate entry which doesn't exist

I'm working on a piece of code to duplicate a database row but with a different foreign key and language id. So, lets say I got 2 tables: TABLE A: - id int PK - image varchar - order_num int - ...
2
votes
3answers
75 views

Exclude Duplicates With Certain Value

I'm been beating my head up against a wall with this all day. I have a SQL Server table called Accounts CREATE TABLE [dbo].[Accounts]( [IDNum] [INT] NULL, [FirstName] [VARCHAR](50) NULL, ...
1
vote
1answer
62 views

How to remove duplicates from any array and preserve ordering in PostgreSQL?

I'm looking for a way to eliminate duplicates from a PostgreSQL array while preserving the ordering of its elements. What I currently have are the following functions: create function array_unique( ...
2
votes
1answer
21 views

Looking for help reporting duplicates and null marks

Someone over at StackOverflow suggested this might be the place to ask this. I hope this will question is proper for this forum. I am looking for suggestions / criticisms of alternative methods of ...
0
votes
0answers
33 views

Duplicate Active Database - Dataguard Oracle 12C

Folks, Good evening. I am performing the configuration of a DataGuard in Oracle 12c. At the time of performing duplicate active database, the process has been aborted, reporting the error below. I ...
5
votes
1answer
201 views

Transfer row from 'parent' to 'child' without creating duplicate and without knowing all 'parent' columns

I want to set up a database with different schemas that correspond to different data-entry systems. There needs to be a “master” (administration) schema with a “parties” table, and multiple other ...
1
vote
1answer
26 views

MySQL - How to convert an existing int column with duplicates to auto-increment?

After adding some thousand records in a table, I noticed that the "Primary" and "Auto-Increment" properties of the main column are removed. Now instead of auto-incremented numbers, most of them (but ...
1
vote
0answers
52 views

How to remove duplicate records from result set of owner

I'm working with one project like rental agreement system. There are two roles types of users (User Role) Signer = 0 Observer = 1 Anyone can register and create a document(which will be referred as ...
0
votes
0answers
15 views

Is it possible to remove duplicate information derived from relationships while preserving constraint?

I am designing an application on MySQL database with the following structure: Competition 1-to-many Course Course 1-to-many Class Course 1-to-many Question Class 1-to-many Participant Question 1-to-...
1
vote
1answer
22 views

Oracle 11gR2, duplicating and refreshing cloned database

Assume I've cloned PROD database to TEST with RMAN "duplicate target database to CLONE from active database;". After several days I need to refresh CLONE. Will RMAN transfer all the datafiles from ...
0
votes
1answer
226 views

How to find index details on Temporary tables in SYBASE

I am a layman in SYBASE world. In order to improve performance, I am creating indexes after data load of temporary tables in many stored procedures. Say, one proc A has an insert into temporary ...
1
vote
2answers
34 views

How can I do a query that shows any row that have more than twice in the same table without using GROUP BY or COUNT

I want to select all same item that occurs in the same table twice without GROUP BY or COUNT sentence. How to write the query? For example, if the table is: City --------- New York Los Angeles ...
0
votes
0answers
28 views

Database Latest Duplicate Query filter

I built a linked database for work that pulls data from another database to track inventory assets. The original database that I am pulling from compiles data of serial numbers from work performed on ...
2
votes
1answer
96 views

Deduplicate Data Using Having with Subquery

I've inherited a DB that was lacking a unique constraint so data was/is duplicated. I'm now trying to remove the duplicate records, then add a constraint to block this going forward. I have this ...
1
vote
0answers
34 views

Renaming duplicate column entries in excel 2007 or librecalc [closed]

I need your help. I have a data set of genes and gene expression values from a DNA microarray experiment. I have 22226 entries in the gene column - some of these entries are duplicates and triplicates....
1
vote
4answers
3k views

Select unique values for one column

There is a table with different sets a(1,2), b(2,3,4) and etc. -- table1 -- set_name | value a | 1 a | 2 b | 2 b | 3 b | 4 c | 3 c | 5 ... | ... ...
2
votes
1answer
123 views

Prevent the collision data because duplicate id from imported database MariaDB

I am currently having a trouble with my Web Application. I made a Web application for a certain company. I made the app using CodeIgniter 3. I built the database using Maria DB. For the id in each ...
1
vote
1answer
57 views

Data Scrub - Duplicate Records

I wanted to delete duplicate records in my database, but it's a little more in depth than just one field. Status ID P 150013511822029 P 150022555544009 P 150022551512029 X 150014520920007 R ...
1
vote
3answers
101 views

How to prevent duplicate or similar data from getting processed?

I have a stored procedure which calculates the distance between 2 coordinate points: CREATE PROC loc.CalcDistanceByPostalCode ( @From VARCHAR(10), @To VARCHAR(10) ) AS BEGIN DECLARE @data table ...
0
votes
0answers
31 views

SQL Agent scheduled job under AlwaysOn run twice on failover machine [duplicate]

Has any experienced this: -SQL Agent scheduled job running over 7 years -Using AlwaysOn for last 3 years -Runs itself (?) within milliseconds but only on the 2ndary machine -SQL Agent only shows one ...
2
votes
1answer
5k views

How do I insert record only if the record doesn't exist?

I have a PaymentInformation table ID NAME Start End 1 Tina 1/7/2014 1/17/2014 2 Alice 3/7/2014 3/17/2014 3 John 5/7/2014 5/17/2014 4 Michelle 7/...
8
votes
1answer
426 views

Duplicate records returned from table with no duplicates

I have a stored procedure that queries a busy queue table that is used to distribute work in our system. The table in question has a primary key on WorkID and no duplicates. A simplified version of ...
3
votes
1answer
462 views

Why does MySQL flag a duplicate key where none exists?

I'm working on adding an auto-increment field to a large table. The field is already populated (roughly 1-500M) and new inserts are manually incrementing correctly. To verify, I ran a query to show ...
1
vote
1answer
35 views

Is this data duplication when two exact pieces of data have different lifespans?

In my system, user has many bank accounts stored in bank_accounts table. Each bank account has a currency column. Now, users can receive payments to those bank accounts, stored in payments table. So, ...
0
votes
1answer
39 views

How PostgresSQL stores duplicated VARCHAR values in a column

I have a VARCHAR(255) column in a table with about 50 million rows. In that column there is only 10 unique values, which act as labels. I'm wondering whether Postgres does something smart and stores ...
1
vote
1answer
591 views

Find rows that have the same value on a column in MySQL

In an employee table, some rows have the same value for the reportsTo column. employeeNumber | reportsTo ---------------|----------------- 1056 | 1002 1076 | 1002 1088 | ...
3
votes
3answers
540 views

Contacts table with multiple entries?

Here is a part of our Database: Table: Users ID INT First Name VARCHAR Last Name VARCHAR Email Address VARCHAR ... Table: Contacts ID INT User_id INT (Foreign Key)...
0
votes
1answer
542 views

Removing duplicate results via subqueries in reference to join conditions for multiple tables

With the code below I was originally attempting to not use sub queries to eliminate "duplicate data" (its technically not duplicate data since each order has several lines of data where prices and ...
0
votes
2answers
394 views

MYSQL ON DUPLICATE KEY UPDATE - updating issue [on hold]

This is probably simple but it's been puzzling me for hours. Task to run a count of _pageviews for _remote_addr (ip address). Each day the table will be truncated to start the counts again. CREATE ...
3
votes
1answer
51 views

XML domains(lookups): Prevent duplicates between domains

Background: I have some GIS domains (a.k.a. lookup tables) that are stored in an XML column in a single system table. The domains are not directly accessible via SQL, so I use a view to extract the ...
4
votes
1answer
660 views

MySQL 5.5 vs 5.6,5.7 above same database same query but different output, limit have duplicated ID

I am using Running same source code and same database for WordPress, only the mysql version is different. It make my pagination post have duplication. Here is what I found out. Any idea how to solve ...
0
votes
1answer
54 views

Manipulate duplicated records

In a table ( in Microsoft Access), I have a large number of records that have duplicated field, for example field-1. I have to change the table and set field-1 as primary key. But as you know, it is ...
1
vote
2answers
595 views

How to select a specific row based on another row from same table [duplicate]

I have a table with duplicated rows, I want to select only one row out of many that has a field populated in it. Example: +--------+------+---------------+ | id | col1 | col2 | +--...
3
votes
1answer
563 views

does INSERT INTO … ON DUPLICATE KEY UPDATE executes even if the row has not changed?

Let me explain : Let us assume we have a database "user" : ID Name Surname =================== 1 John Doe 2 Foo Bar 3 Foo Baz Now I wanna change all these three rows. I will ...
3
votes
2answers
571 views

Remove Duplicate Entries from DB w/ Unique ID that is NOT Primary Key - Keep one of course!

I have a CDR Table with a "unique id" column which is not a Primary Key. During an upgrade, there were a few days where instead of one entry for a caller ringing a queue, there was multiple entries ...
1
vote
1answer
72 views

Is OLAP cube duplication of data?

Is an OLAP cube a duplication of data or is it just references to original tables? Or can I control it?
0
votes
1answer
205 views

Triggers that inserts values to a table from another table

I am trying to create a report table that contains drug_id, total sales and average sales from an inventories table. This code doesn't work as it should. It duplicates records and when I insert ...
1
vote
3answers
63 views

Query that Searches Duplicate Values Based on a Specific Value

I've been searching through forums all morning and haven't been able to make much progress. The system I work with has a particular table that will assign two unique values to a row - we'll say ID01, ...
0
votes
1answer
326 views

Multiple Left Join Fetch Duplicate Data

I am having duplicates data with this enormous query. SELECT t2.`1st_test` AS agric1, t2.`2nd_test` AS agric2, t2.exam AS agricExam3, t2.result_total AS agricTotal, ...
0
votes
1answer
2k views

How do I export Postgres data in “Insert … on conflict” format instead of “cp” format?

I’m using Postgres 9.5 on Mac Sierra. I want to export some records from my local db and import them into a db on a Linux machine (also running PostGres 9.5). I’m using this command to export data ...
3
votes
2answers
530 views

Use utl_match.jaro_winkler_similarity to select distinct rows using Oracle

I have a table with log messages that many times contain repeated information with slightly different values. For example: Unable to make thread 19043 a realtime process Unable to make thread 20763 ...