Re: Removing duplicate rows in table - Mailing list pgsql-general

From Rich Shepard
Subject Re: Removing duplicate rows in table
Date
Msg-id 41c47eb5-f6b-8e29-98e6-f6b1fa733bb@appl-ecosys.com
Whole thread Raw
In response to Re: Removing duplicate rows in table  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Removing duplicate rows in table
Re: Removing duplicate rows in table
List pgsql-general
On Tue, 10 Sep 2024, Adrian Klaver wrote:

> You might want to do something like:
>
> select proj_nbr, count(*) as ct from projects group by proj_nbr;
>
> to see how big a problem it is. If it is only a few projects it could just a 
> matter of manually deleting the extras.

Adrian,

It's a small table, not updated in a while. Looking at the example I sent
how do I delete the extras while keeping one when each row has the same
content? Not knowing how to do that is why I wrote.

> Whatever you do:
> 1) Make sure you have a backup of at least that table.
> 2) Do the data changes as BEGIN; <changes> COMMIT; or ROLLBACK;

Yep. Learned that lesson.

Thanks,

Rich

P.S. Please reply to the mail list so I receive only one copy of your
message, not two.



pgsql-general by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: Removing duplicate rows in table
Next
From: Rich Shepard
Date:
Subject: Re: Removing duplicate rows in table