Home
> Linux, PostgreSQL, Slackware > Linux : Slackware : PostgreSQL 8.3.7 find the duplicates in a table
Linux : Slackware : PostgreSQL 8.3.7 find the duplicates in a table
“PostgreSQL 8.3.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2″
ext_id should be unique, but its not, so to get all the records with duplicate ext_id :
select
ext_id
from dd_out dd
where true
and ext_id in
(
select ext_id as ddd from (
select count(s.ext_id) as cnt, s.ext_id from dd_out s where true group by s.ext_id
) as cra
where cnt > 1
)
;
Categories: Linux, PostgreSQL, Slackware
duplicates, postgresql, Slackware, SQL
Comments (0)
Trackbacks (0)
Leave a comment
Trackback