Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id B3A994759CC for ; Fri, 19 Apr 2002 05:46:53 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Fri Apr 19 11:46:50 2002 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id LAA26903; Fri, 19 Apr 2002 11:46:49 +0200 (METDST) From: Christoph Haller Message-Id: <200204190946.LAA12543@rodos> Subject: Re: count different values in column To: berger1517@gmx.ch (Albrecht Berger) Date: Fri, 19 Apr 2002 11:46:48 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: <007901c1e784$e3c21010$a57ba8c0@wxp>; from "Albrecht Berger" at Apr 19, 102 11:29 am X-Mailer: Elm [revision: 212.4] X-Archive-Number: 200204/241 X-Sequence-Number: 7505 select max(count) from ( select a, count(a) from Resulttable group by a ) as foo; max ----- 3 (1 row) should do it. Regards, Christoph > Hello, > today I have a new question :) > > I've a resulttable is generated by a couple of subselects and joins which > contains only one column. > > Now I want to count the different values in the column. > > Resulttable : > a > ------ > 10 > 12 > 12 > 12 > 14 > 14 > 15 > > I need the value which is repeated most in the resulttable (in this example > 12 ) ! > > > Any suggestions ? > > > Thx > berger >