![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Trouble
======================= The following SQL works in MS Access but denies in MySQL; "DELETE FROM tblcdr WHERE tblcdr.CID IN (SELECT CID FROM tblcdr AS C WHERE C.CID = tblcdr.CID AND C.cdrID > tblcdr.cdrID)" ======================= "tblcdr" specification ======================= CDRID -> int, auto_increament CDID -> int ======================= Purpose ======================= I am capturing data from a hardware device that serves the data in CSV format. I then export the data right into the database. Upto this part, thigns are alright. Now, whenever I lose connectivity with the device, it starts from the start of the data stream when I reconnect with it. It causes the duplication of thousands of data thousand times. So I needed an SQL DELETE query that will delete the rows that are the duplicates leaving the parent (orginal) row intact. Here the CDID column is the unique identifier supplied by the device, so for the rows with same CDID, we can call them duplicates. Please don't be confused with CDRID & CDID. CDRID is the actual IDENTITY column in the table & values for CDID is supplied by the device. ======================= I am using MySQL Server 4.0.16-nt. Thanks in advance... Last edited by SKJoy2001; 02-16-2005 at 06:19 AM.. |
|
|
|
|
|
PM User | #2 |
|
Regular Coder ![]() Join Date: Jun 2002
Location: Sheffield, UK
Posts: 552
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
what version of mysql do you have? subqueries only work in 4.1 or higher.
__________________
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds" (Me Me Me Me Me Me Me Me Me) |
|
|
|
|
|
PM User | #4 | |
|
New to the CF scene Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Quote:
But, I've previously installed the latest from MySQL official site, but after that, nothing of my clients (PHPMyAdmin, MySQL Control Center, etc.) worked with it, some of them couldn't authenticate with the MySQL server & some of them just crashed! Then I reverted back to this MySQL version. Any idea? |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|