MySQL Forums
Forum List  »  MyISAM

Re: "WITH ROLLUP" and "NOT NULL" columns
Posted by: Anthony Willard
Date: November 17, 2005 05:41PM

Felix,

Thanks for the reply, and yes, I wasn't sure if this was the correct forum.

Basically, I don't evaluate the super-aggregate in a HAVING clause, but rather, as a field in the set similar to :

Select Field1,
case when Field2 is null then "Total" else Field2 end as Field2,
sum(Field3) as Field3Total
from mytable
group by Field1, Field2

If the column Field2 is not defined as "NOT NULL", I don't get any records with the value of "Total" in Field2, but do get a null value. If the column is defined as "NULL", it works fine.

Does this help to clarify my question?

Options: ReplyQuote


Subject
Views
Written By
Posted
4764
November 15, 2005 12:00PM
Re: "WITH ROLLUP" and "NOT NULL" columns
1944
November 17, 2005 05:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.