Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9B9429FBC4C for ; Tue, 29 May 2007 17:35:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 78655-03 for ; Tue, 29 May 2007 17:35:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by postgresql.org (Postfix) with SMTP id 687609FBBE1 for ; Tue, 29 May 2007 17:35:07 -0300 (ADT) Received: (qmail 53829 invoked by uid 60001); 29 May 2007 20:35:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=kY+VzNdAbU1vEZb2KGsR6DeF1r9Hsh2ho4q/im7v++QIJ6H3VoehVgBB75U+Ib5ZQ2bpQshjH/cGcNvZayh43Rs7c7c5cH5ZrEnXz3SJvGmdyYlZ2ZtYblLghRAFgUNJzuCSCZ0NRjHSgUoEYcAPvVL02dw/a3XsUnHYQYm1i3Q=; X-YMail-OSG: HsQHrOwVM1mzgMF6P5cwV9nsqolEixsaNRJZprGMNpyFtLONVV73jJzfUzpa8UG46nIhNQ-- Received: from [63.203.180.122] by web31812.mail.mud.yahoo.com via HTTP; Tue, 29 May 2007 13:35:06 PDT Date: Tue, 29 May 2007 13:35:06 -0700 (PDT) From: Richard Broersma Jr Subject: Re: problems with SELECT query results To: Joshua , Richard Huxton Cc: pgsql-sql@postgresql.org In-Reply-To: <465C6705.5000505@joshuaneil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <267552.53183.qm@web31812.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.066 tagged_above=0 required=5 tests=AWL=-1.290, BAYES_50=0.001, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: ** X-Archive-Number: 200705/188 X-Sequence-Number: 28468 --- Joshua wrote: > Hello, > > Thank you all for your assistance. I did end up finding NULL in the > 'onorder' column which should have been zero's.... this was in a test > table that happened to have some NULL in it for one reason or another > but I should not find this in the production version of the table. If this should be allowed to have nulls, you should add a not null constraint to your table to prevent this sort of thing from happening. If a field should have zero's instead of nulls, you should also add a default value of zero for this column. ALTER TABLE Slparts ALTER COLUMN onorder SET NOT NULL, ALTER COLUMN onorder SET DEFAULT 0; Regards, Richard Broersma Jr.