Search Postgresql Archives

how to remove the duplicate records from a table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a table contains some duplicate records, and this table create
without oids, for example:
 id | temp_id 
----+---------
 10 |       1
 10 |       1
 10 |       1
 20 |       4
 20 |       4
 30 |       5
 30 |       5
I want get the duplicated records removed and only one is reserved, so
the results is:
10 1
20 4
30 5

I know create a temp table will resolve this problem, but I don't want
this way:)

can someone tell me a simple methold?

any help is appreciated,

thanks,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux