Re: [SQL] unique fields

2010-09-23 Thread Oliveiros d'Azevedo Cristina
Howdy, Adrian Dunno if this is exactly what you want SELECT * FROM ( SELECT chr,cfrom,cto,count(*) as numberOfDuplicates FROM t_fairly_large_table GROUP BY chr,cfrom,cto ) x NATURAL JOIN t_fairly_large_table y WHERE numberOfDuplicates > 1 The idea of this (untested) query is to produce somet

Re: [SQL] unique fields

2010-09-23 Thread Sergey Konoplev
Hi, On 23 September 2010 07:30, Adrian Johnson wrote: > I want to find out how many duplications are there for chr, cfrom and cto Start with it http://www.postgresql.org/docs/9.0/interactive/tutorial-agg.html p.s. SELECT chr, cfrom, cto, count(*) FROM your_table GROUP BY 1, 2, 3; > > a.   c2,