Skip to content

Commit 63677c1

Browse files
committed
add SQL for duplicates check
1 parent f0680a5 commit 63677c1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

importer/duplicates.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
select f.*, o.name from
2+
(select o.name, parent, postal_code, t.name as type_name, count(*) as cnt from object_primary o
3+
join "type" t on t.id = o.type_id
4+
group by o.name, parent, postal_code, t.name
5+
order by cnt desc
6+
limit 25) f
7+
join object_primary o on f.parent=o.id

0 commit comments

Comments
 (0)