Re: Multiple occurence - Mailing list pgsql-novice

From David Johnston
Subject Re: Multiple occurence
Date
Msg-id 1395070604063-5796345.post@n5.nabble.com
Whole thread Raw
In response to Multiple occurence  (Nipuna <nipunajoset@gmail.com>)
List 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.


pgsql-novice by date:

Previous
From: Nipuna
Date:
Subject: Multiple occurence
Next
From: Rajmohan C
Date:
Subject: plan forcing in postgresql