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
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:
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?
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