Re: Fw: [GENERAL] select null + 0 question

2003-07-15 Thread Richard Huxton
On Tuesday 15 Jul 2003 7:38 pm, Vincent Hikida wrote: > OK. This has been bothering me. I finally recreated what I remember as an > anomoly in Oracle involving nulls. It also works the same way in > PostgreSQL. I guess in mind I extrapolated that there was a problem with > "WHERE 1 IN (1,2,NULL)" w

Re: Fw: [GENERAL] select null + 0 question

2003-07-14 Thread Csaba Nagy
ctually > > stung by this particular while using it in Oracle. > > > > Vincent Hikida, > > Member of Technical Staff - Urbana Software, Inc. > > "A Personalized Learning Experience" > > > > www.UrbanaSoft.com > > > > - Original Mess

Re: Fw: [GENERAL] select null + 0 question

2003-07-14 Thread Stephan Szabo
On Sun, 13 Jul 2003, Vincent Hikida wrote: > Oops forgot to cc the list. > > > Unfortunately, intra-row functions using nulls return nulls. Inter-row > > functions "usually" ignore the nulls. I think there may be a few > exceptions. > > Though there is a relational theory which has is rigorously

Re: Fw: [GENERAL] select null + 0 question

2003-07-13 Thread Martijn van Oosterhout
On Sun, Jul 13, 2003 at 11:14:15PM -0700, Vincent Hikida wrote: > Oops forgot to cc the list. > > I just happened to notice another difference recently between Oracle and > > Postgresql for the clause > > > > WHERE 1 IN (1,2,NULL) > > > > In Oracle, this clause is false because 1 compared to a NULL

Re: [GENERAL] select null + 0 question

2003-07-13 Thread Mike Mascari
Jean-Christian Imbeault wrote: > Why is it that "select null + 1" gives null but "select sum(a) from > table" where there are null entries returns an integer? > > Shouldn't the sum() and "+" operators behave the same? --- SQL92 (6.5 ): 1) Case: a) If COUNT(*) is specified, then the result is

Re: [GENERAL] select null + 0 question

2003-07-13 Thread Joe Conway
Jean-Christian Imbeault wrote: Shouldn't the sum() and "+" operators behave the same? No, see SQL99, Section 6.16, General Rules 1.b: "Otherwise, let TX be the single-column table that is the result of applying the to each row of T and eliminating null values. If one or more null values are eli

Fw: [GENERAL] select null + 0 question

2003-07-13 Thread Vincent Hikida
ssage - > From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, July 13, 2003 10:42 PM > Subject: [GENERAL] select null + 0 question > > > > Why is it that "select null + 1" gives null but &

Re: [GENERAL] select null + 0 question

2003-07-13 Thread listrec
: Montag, 14. Juli 2003 07:42 An: [EMAIL PROTECTED] Betreff: [GENERAL] select null + 0 question Why is it that "select null + 1" gives null but "select sum(a) from table" where there are null entries returns an integer? Shouldn't the sum() and "+" operators beha

[GENERAL] select null + 0 question

2003-07-13 Thread Jean-Christian Imbeault
Why is it that "select null + 1" gives null but "select sum(a) from table" where there are null entries returns an integer? Shouldn't the sum() and "+" operators behave the same? TAL=# select null + 0; ?column? -- (1 row) TAL=# select * from a; a --- 1 (3 rows) TAL=# select sum(a) fr