Bug #6899 | rollup as name | ||
---|---|---|---|
Submitted: | 30 Nov 2004 23:17 | Modified: | 14 Jun 2013 0:11 |
Reporter: | Randall Wiggins | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server | Severity: | S4 (Feature request) |
Version: | 4.1.7 | OS: | Any (Any) |
Assigned to: | CPU Architecture: | Any |
[30 Nov 2004 23:17]
Randall Wiggins
[28 Mar 2008 17:37]
Jorge Bernal
You can achieve similar results with something like this SELECT IFNULL(Continent,"Total count") AS Continent, SUM(Population) FROM Country GROUP BY Continent WITH ROLLUP;
[19 Apr 2009 21:03]
E Van den Boogaard
The manual has comments on this (see MySQL 5.1 on 11.12.2. GROUP BY Modifiers): "There is one gotcha, if the column value itself has a NULL value, you may see undefined behavior." Examples used there: IFNULL(fieldname,"fieldData") and COALESCE(fieldname,"fieldData").