I would be fetching N duplicate records and I want to update only N-1 records from one table only(MySQL database). fetching and updating would be one table. We do have primary key 'id' with auto_increment. Any help with the sample code would be much appreciated. Thanks in advance.