Received: from nexus.kearneydev.com (IDENT:root@nexus.kearneydev.com [208.136.214.2]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA28140 for ; Fri, 14 May 1999 12:57:40 -0400 (EDT) (envelope-from secret@kearneydev.com) Received: from kearneydev.com (atu.kearneydev.com [208.136.214.93]) by nexus.kearneydev.com (8.8.5/8.8.5) with ESMTP id MAA31574 for ; Fri, 14 May 1999 12:57:37 -0400 Message-ID: <373C5600.89E98420@kearneydev.com> Date: Fri, 14 May 1999 12:57:37 -0400 From: secret Organization: Kearney Development Co., Inc. X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: PG-SQL Subject: Oddities with NULL and GROUP BY Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Maybe there is something I don't know about how GROUP BY should work, but if I have a table like: a,b,c 1,1,1 1,1,2 1,1,3 1,2,1 1,3,1 And I say SELECT a,b,sum(c) FROm .. GROUP BY a,b I get 1,1,6 1,2,1 1,3,1 So whenever a or b changes we get a new summed row, well if I have rows where a or b are null, this doesn't happen, infact I seem to get all those rows individually... Like if: 1,1,1 1,1,3 1,NULL,10 1,NULL,20 1,2,3 I get: 1,1,4 1,NULL,10 1,NULL,20 1,2,3 Shouldn't I get 1,NULL,30? Ie shouldn't NULL be treated like any other value? Or is there some bit of information I'm missing? I can set everything from NULL to 0 if need be, but I'd rather not... David Secret MIS Director Kearney Development Co., Inc.