"WITH ROLLUP" and "NOT NULL" columns
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.
Subject
Views
Written By
Posted
"WITH ROLLUP" and "NOT NULL" columns
4747
November 15, 2005 12:00PM
2897
November 15, 2005 12:31PM
1935
November 17, 2005 05:41PM
1915
November 18, 2005 01:55AM
1866
November 18, 2005 09:07AM
1867
June 19, 2006 07:19PM
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.