Re: Multiple occurence

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Multiple occurence
Date: 2014-03-17 15:36:44
Message-ID: 1395070604063-5796345.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

nipuna wrote
> select file_name,filesize, full_path from duplicate_files f1 where
>
> (file_name,filesize) in (select file_name,filesize from duplicate_files
> group by file_name,filesize having count(file_name) >1);

Maybe:

Select file_name, filesize, array_agg(full_path)
From duplicate_files
Group by file_name, filesize
Having count(*) > 1

You can always unnest the array later if needed.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Multiple-occurence-tp5796336p5796345.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rajmohan C 2014-03-17 15:53:01 plan forcing in postgresql
Previous Message Nipuna 2014-03-17 14:29:40 Multiple occurence