There is probably a more elegant way of doing it, but a simple way of
doing it ( depending on the size of the table ) could be:
begin;
insert into foo select distinct * from orig_table;
delete from orig_table;
insert into orig_table select * from foo;
commit;
-Said
A B wrote:
I have a table with rows like this
A 1
A 1
B 3
B 3
C 44
C 44
and so on.
and I want it to be
A 1
B 3
C 44
so how can I remove the all the duplicate lines but one?
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general