Re: [SQL] SELECT MAX returns wrong value

2007-12-14 Thread Scott Marlowe
On Dec 13, 2007 5:09 PM, Gavin Baumanis <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > Sorry if I am missing something obvious but I think I have found a bug. > If I perform the following SQL > > SELECT MAX(column) FROM table WHERE expression > > and there is no match, Postgres returns a record coun

Re: [SQL] SELECT MAX returns wrong value

2007-12-13 Thread Tom Lane
Gavin Baumanis <[EMAIL PROTECTED]> writes: > If I perform the following SQL > SELECT MAX(column) FROM table WHERE expression > and there is no match, Postgres returns a record count of 1. > There is no value in max, it is NULL. This is the behavior required by the SQL standard. > Thus trying to

[SQL] SELECT MAX returns wrong value

2007-12-13 Thread Gavin Baumanis
Hi Everyone, Sorry if I am missing something obvious but I think I have found a bug. If I perform the following SQL SELECT MAX(column) FROM table WHERE expression and there is no match, Postgres returns a record count of 1. There is no value in max, it is NULL. Thus trying to perform some "oth