Re: Bug in GROUP BY/CASE/MAX?

2002-12-10 Thread 'Bob Diss'
RE: Bug in GROUP BY/CASE/MAX? Well, according to my reading/understanding of SQL ANSI'92, MAX/MIN/SUM/AVG are supposed to eliminate the NULLs from the set before doing the appropriate calculation... Bob Diss, [EMAIL PROT

Re: Bug in GROUP BY/CASE/MAX?

2002-12-10 Thread Dan Nelson
In the last episode (Dec 10), 'Bob Diss' said: > RE: Bug in GROUP BY/CASE/MAX? > > More info -- it seems that if I change the 'NULL' to '' > (i.e. the empty string) in the CASE statements, I get the > result I'm looking for. That is, the query:

Re: Bug in GROUP BY/CASE/MAX?

2002-12-10 Thread gerald_clark
What is the MAX of a known and an unknown value? It would be unknown or NULL 'Bob Diss' wrote: RE: Bug in GROUP BY/CASE/MAX? More info -- it seems that if I change the 'NULL' to '' (i.e. the empty string) in the CASE statements, I get the result I'm looki

RE: Bug in GROUP BY/CASE/MAX?

2002-12-10 Thread 'Bob Diss'
RE: Bug in GROUP BY/CASE/MAX? More info -- it seems that if I change the 'NULL' to '' (i.e. the empty string) in the CASE statements, I get the result I'm looking for. That is, the query: mysql> select max(case when col = 1 then val else '' end) as color