![]() |
|
#1
|
|||
|
|||
Moving data from MySQL to MySQLQUICK EXPLANATION: I'm looking for a way to check each record in result from MySQL Server 1 (MySQL1) quickly against those already in MySQL Server 2 (MySQL2) and make decisions on whether to keep them or not based on business rules.
DETAILED EXPLANATION: I am building a PHP script to move data from a MySQL database on one server (MySQL1) to a MySQL Instance on a different server (MySQL2). I am retrieving records with an end_date column value that falls between the current date and the date of the last collection. One of the columns is a unique identifier, ProjectID, which will be stored in MySQL2 ISSUE: I need to verify that no project records retrieved from MySQL1 are duplicates of those already inserted into MySQL2 from a previous collection (this case could occur in a few scenarios, for example, a user changes the end date column for a project). Once I have a SELECT result from MySQL1, say: Code:
how do I check these project_ids against those already in MySQL2: Code:
If a project_id is a duplicate but has a different end_date, I want to keep the most recent. If a project_id is a duplicate and the rest of the record is identical, I want to ignore the new record. Thanks for the help! |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Archiving and Retrieving data using java with mysql | bryan523 | Java Forum | 2 | 04-Jun-2006 20:06 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| Strange C++ code memory leakage problem | gaoanyu | C++ Forum | 7 | 04-Nov-2005 08:09 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The