List:General Discussion« Previous MessageNext Message »
From:william drescher Date:March 30 2014 11:18am
Subject:Re: Help with cleaning up data
View as plain text  
On 3/29/2014 2:26 PM, william drescher wrote:
> I am given a table: ICD9X10 which is a maping of ICD9 codes to
> ICD10 codes.  Unfortunately the table contains duplicate entries
> that I need to remove.
>
> CREATE TABLE `ICD9X10` (
>   `id` smallint(6) NOT NULL AUTO_INCREMENT,
>   `icd9` char(8) NOT NULL,
>   `icd10` char(6) NOT NULL,
>   PRIMARY KEY (`id`),
>   UNIQUE KEY `icd9` (`icd9`,`id`),
>   UNIQUE KEY `icd10` (`icd10`,`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=671 DEFAULT CHARSET=ascii
>
> id   icd9  icd10
> 25   29182 F10182
> 26   29182 F10282
> 27   29182 F10982
>
> I just can't think of a way to write a querey to delete the
> duplicates.  Does anyone have a suggestion ?
>
> bill
>
>


Thanks for all the suggestions.  I learned a lot, which is the 
most important part of the exercise.

bill

Thread
Help with cleaning up datawilliam drescher29 Mar 2014
  • Re: Help with cleaning up dataFran Garcia29 Mar 2014
  • Re: Help with cleaning up dataCarsten Pedersen29 Mar 2014
  • RE: Help with cleaning up dataDavid Lerer30 Mar 2014
  • Re: Help with cleaning up datawilliam drescher30 Mar 2014
Re: Help with cleaning up dataBob Eby31 Mar 2014