On Thu, 12 Sep 2024, Muhammad Usman Khan wrote:
You can try the following CTE which removes all the identical rows and only
leave single row
Thank you, Muhammed.
Rich
On 2024-09-10 18:38 +0200, Rich Shepard wrote:
> P.S. Please reply to the mail list so I receive only one copy of your
> message, not two.
You can configure your list subscription to not receive an extra copy.
That setting is under "Global configuration" on
https://lists.postgresql.org/manage/.
-
On Tue, 10 Sep 2024, Rich Shepard wrote:
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.
Not knowing how to do that is why I wrote.
A web search (which I should have done before posting this thread) shows me
how to do this
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, n
On 9/10/24 08:29, Rich Shepard wrote:
On Tue, 10 Sep 2024, Adrian Klaver wrote:
Is there a Primary Key or Unique index on this table?
Adrian,
No. It didn't occur to me to make the project number a PK as this table is
not related to others in the database.
But, yesterday it occurred to me to
On Tue, 10 Sep 2024, Andreas Kretschmer wrote:
you can use the hidden ctid-column:
postgres=# create table demo (id int, val text);
CREATE TABLE
postgres=# insert into demo values (1, 'test1');
INSERT 0 1
postgres=# insert into demo values (1, 'test1');
INSERT 0 1
postgres=# insert into demo va
On Tue, 10 Sep 2024, Christophe Pettus wrote:
If you don't mind taking the time to swap tables, you can always do an
INSERT ... SELECT DISTINCT into a new table, and then swap it
with the existing table.
Christophe,
I'll make the proj_nbr table the PK then do as you recommend.
Thank you,
R
On Tue, 10 Sep 2024, Francisco Olarte wrote:
Do you have any kid of corruption (i.e, unique index violation) or is
it just a duplicate problem?
Francisco,
Only a duplicate problem because when I created this table I didn't make the
proj_nbr column a PK.
Also, if you do not have any uniquene
On Tue, 10 Sep 2024, Adrian Klaver wrote:
Is there a Primary Key or Unique index on this table?
Adrian,
No. It didn't occur to me to make the project number a PK as this table is
not related to others in the database.
But, yesterday it occurred to me to make the proj_nbr a PK to eliminate
fu
Am 10.09.24 um 17:07 schrieb Rich Shepard:
I've no idea how I entered multiple, identical rows in a table but I
want to
delete all but one of these rows.
Here's an example:
bustrac=# select * from projects where proj_nbr = '4242.01';
proj_nbr | proj_name | start_date | end_date | de
On 9/10/24 08:07, Rich Shepard wrote:
I've no idea how I entered multiple, identical rows in a table but I
want to
delete all but one of these rows.
Is there a Primary Key or Unique index on this table?
Here's an example:
bustrac=# select * from projects where proj_nbr = '4242.01';
proj_
I've no idea how I entered multiple, identical rows in a table but I want to
delete all but one of these rows.
Here's an example:
bustrac=# select * from projects where proj_nbr = '4242.01';
proj_nbr | proj_name| start_date | end_date | description | notes
--+
12 matches
Mail list logo