Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id ACA2C9FB2EE for ; Tue, 20 Feb 2007 08:34:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 24631-01 for ; Tue, 20 Feb 2007 08:34:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id C35E29FB2C9 for ; Tue, 20 Feb 2007 08:34:29 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HJUCI-0007Bn-4q for pgsql-sql@postgresql.org; Tue, 20 Feb 2007 13:34:18 +0100 Received: from pc035-72.amg.gda.pl ([153.19.72.35]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Feb 2007 13:34:18 +0100 Received: from mstepnicki by pc035-72.amg.gda.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Feb 2007 13:34:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: =?iso-8859-2?q?Marcin_St=EApnicki?= Subject: Re: DISTINCT ON not working...? Date: Tue, 20 Feb 2007 13:33:55 +0100 Organization: Linux.PL Lines: 24 Message-ID: References: <19666.1171945956@sss.pgh.pa.us> <00e601c754a8$b2428010$9b0014ac@wbaus090> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pc035-72.amg.gda.pl User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux)) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.161 tagged_above=0 required=5 tests=BAYES_05, INFO_TLD, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/208 X-Sequence-Number: 27542 Dnia Tue, 20 Feb 2007 15:36:32 +1100, Phillip Smith napisał(a): > Removing the CASE statement all together: > SELECT DISTINCT ON (ean) > ean, > count(*) > FROM TMPTABLE > WHERE code NOT IN (SELECT code FROM stock_deleted) > AND ean IS NOT NULL > GROUP BY ean > > Still gives me: > 3246576919422 2 Wild guess - have you tried reindexing this table? I haven't seen corrupted indexes since 7.1, though - it usually means subtle hardware problems. -- | And Do What You Will be the challenge | http://apcoln.linuxpl.org | So be it in love that harms none | http://biznes.linux.pl | For this is the only commandment. | http://www.juanperon.info `---* JID: Aragorn_Vime@jabber.org *---' http://www.naszedzieci.org