MySQL Forums
Forum List  »  MyISAM

"WITH ROLLUP" and "NOT NULL" columns
Posted by: Anthony Willard
Date: November 15, 2005 12:00PM

I'm trying to summarize some data and use the "WITH ROLLUP" clause to generate the totals. In my "SELECT", I'm trying to use a "CASE" statement to replace the "NULL" value produced by the "WITH ROLLUP" with text indicating that this row represents a break total for this column.

When I use this construct on column defined as "NOT NULL", the CASE" never matches the column as "IS NULL" and I never get my control break text in the result, only the "NULL" value. If I change the column definition to "NULL", then it works as expected.

The value is on a table "INNER JOIN"ed to the primary table.

I'm using MySQL v5, my tables are MyISAM, on a WinXP Professional configuration.

Did the optimizer remove the construct in the "SELECT" clause because of the column definition, "NOT NULL"? Is this behavior as intended?

If I need to provide sample SQL, please let me know and I can post a simplified example.

Anthony.

Options: ReplyQuote


Subject
Views
Written By
Posted
"WITH ROLLUP" and "NOT NULL" columns
4747
November 15, 2005 12:00PM


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.