The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
34 views

Optimizing Queries HAVING COUNT and INSERT…ON DUPLICATE KEY UPDATE

There are two main queries I'm tying to improve, one question is much more conceptual and learning about databases and another is much more straightforward. Both cases deal with the same table It has ...
0
votes
1answer
16 views

MySQL RDS Error 1062

Normally we can skip 1062 duplicate error but in rds can we skip multiple 1062 errors in one go. For example we define slave skip error =1062 in my.cnf and restart slave. but in RDS MYSQL how can we ...
1
vote
1answer
48 views

How does RANK() work in this query? [closed]

I want to delete duplicate rows from a table. I have searched for the query online, and found the following sample: DELETE FROM dbo.LeadsContacts WHERE Sr_No IN ( SELECT Sr_No FROM ( ...
0
votes
1answer
79 views

How to remove duplicates and keep the one with the most additional information

I have a postgres table (postgres version 9.3.4) of addresses with duplicate addresses: Column | Type | Modifiers ...
-1
votes
1answer
42 views

SELECT rows with duplicate values

I have a table of names in mysql InnoDB as Firstname Lastname Steve Ross John Doe J. Doe Mike Ross Michael Ross Roger ...
0
votes
0answers
22 views

How to get records in group when records are duplicated?

I have following table structure. Here id is primary key and auto incremented.Here Records are duplicated and id with 1 is parent records and id with 2 & 3 are its child records. same with id ...
0
votes
1answer
26 views

Uniq join 3 tables with relationship table not uniq

I am using Postgres. I have 3 tables: table_1 id table_1_2 table_1_id, table_2_id table_2 id The problem is the relationship table table_1_2 is not uniq. I.e., table_1_2 will have the ...
1
vote
1answer
77 views

Delete Duplicates Leaving One of Two Identical Records [closed]

Delete Duplicates Leaving One of Two Identical Records One of my MySQL database tables contains four BLObs in each row. When it was first set up the table had no keys. However when I now try to add a ...
0
votes
1answer
115 views

Oracle: duplicate schema to another database

I want to copy an Oracle schema from a production database to a validation database. Both databases are Oracle 11g R1 standard edition and need less interrupting time as I can (but I can do if it ...
4
votes
2answers
265 views

Duplicate database leaves orphan archivelog files

I am cloning the production database to another one, lets say CLONEDB, in a regular basis. I am using rman duplicate database script like: run { duplicate target database to CLONEDB FROM ACTIVE ...
1
vote
1answer
641 views

Remove all records with duplicates in db2. (Not just the duplicate records)

How can I remove all the records with duplicates in db2. I have looked at various answers but they only remove the duplicates leaving one record from that set in the table. This is what I found ...
0
votes
1answer
128 views

Remove duplicate terms from column

This the tags column where all terms should be listed only once. Would like to remove all additional words from this column. For example the below contant: Lakshmi Bar & Restaurant, Dining ...
1
vote
1answer
468 views

Using EXCEPTION to ignore duplicates during bulk inserts

In pq 9.3.5, I'm importing records from an external source where duplicates are VERY rare, but they do happen. Given a readings table with a unique compound key on (real_time_device_id, recorded_at), ...
0
votes
0answers
85 views

Looking for a recipe to merge multiple rows to single row

I have a aggregation table that is written by multiple processors (around 20). Each row has a composite key - location-id, campaign-id,... and aggregate stats about it. I need to merge the ...
5
votes
2answers
475 views

Partial db dump/restore

A part of my database (PostgreSQL 9.3) relies on extra tables (ex. County, City, Town, ... ). I don't manage these tables, they are updated regularly by a third party. Each time I get a new full dump, ...
0
votes
1answer
1k views

Oracle Duplicate Database with no archived logs

I am trying to perform a duplicate operation from one server to another (testing disaster recovery) on oracle 11g. I am very much still learning about Oracle. The system is not in production, it is ...
0
votes
0answers
109 views

duplicate/restore a prod database to a test with RMAN

we have RMAN using RMAN CATALOG and takes backup to TSM Tape! what is the standard method to clone/copy/restore a database to a new host with a new instance name? I just need the RMAN script, I ...
0
votes
1answer
86 views

duplicate entry issue with large mysql database table

I have a very large my sql database table. The other day, for no apparent reason, I now keep getting :- Duplicate entry '148245' for key 'PRIMARY' If I remove the entry at with primary of 148245, ...
3
votes
1answer
90 views

Consolidating 2 Tables with same Values

I am working on a project trying to consolidate two databases, DB1 and DB2, for my organization into a single database, DB3. Initially our organization started with DB1. A few years back they made a ...
5
votes
1answer
352 views

Percona MySQL 5.5 Unique key is duplicated

I'm totally out from ideas, so maybe somebody else could answer my question. We have a MySQL 5.5 server from Percona with high traffic. The application is in PHP and writes always to master. We have ...
-1
votes
1answer
127 views

Why Do I Still Get a Duplicate Entry Error When There is No Duplicate Entry?

I am trying to insert this data into my database: https://docs.google.com/spreadsheet/ccc?key=0AjQflI82acM3dFI1Mk04dWlYSFJtM0hsZ0g4ZlExMWc&usp=sharing I receive the following error: 1062 - ...
0
votes
2answers
231 views

Make Oracle backup files available for duplicate

I have a Red Hat Enterprise Linux server with Oracle 10.2.0.5 and a database on it (SID is TNATEST). I have a remote CentOS server with Oracle 10.2.0.5 on it that I want to duplicate TNATEST to. The ...
0
votes
1answer
57 views

What is meant by the RMAN Duplicate “noncurrent point in time”?

When doing a RMAN DUPLICATE from backup connected to the target, how current does the duplication make the database when no until time is set? The closest thing I can find in the documentation is the ...
1
vote
2answers
2k views

Insert into … (…) (Select…) on dupliacate key update

Can you help me to solve a problem. The task is to insert a record in MySQL database. terms: If the record exists - to update the record. If the record does not exist - to create a new one. The Key ...
2
votes
2answers
3k views

Master - Master replication Duplicate entry

I've got a Master - Master replication setup and it worked fine for a couple of days but I keep getting: Duplicate entry errors after a few days... My setup is as follow: One server in The ...
0
votes
1answer
6k views

INSERT / UPDATE to merge data, when empty data is an empty string

Consider a table of some family members: mysql> SELECT * FROM some_table; +--------+--------+--------+ | f_name | l_name | work | +--------+--------+--------+ | Meirav | Cohen | school | | ...
6
votes
3answers
46k views

select rows where column contains same data in more than one record

I have a table that has a column called article_title. Let's say the table name is articles. I need to find out the records where the article_title data is the same on more than one record. Here's ...
1
vote
1answer
109 views

Should I duplicate the data or have linking table?

We have the following data: Collections of items Individual items These will go into the following tables: ItemCollectionTable (Id, Name, OtherFields (desc, date, etc..)) ItemTable (Id, ...
1
vote
1answer
2k views

Duplicate database for standby returns error ORA-19625: error identifying file /home/oracle/stdbyctrl.ctl

I'm working on creating duplication scripts for standby purposes. and it's constantly failing even though the backups are located in the exact same folder. DB structure is identical and spfile is ...
8
votes
4answers
2k views

How to check if a subquery has exactly one distinct result and a specified value concisely?

I found myself writing the following: select 'yes' where exists(select * from foo where val=1) and not exists(select * from foo where val<>1); and wondering if there is a more concise way ...