Bug #21728 MySQL Rollup Testing and check failure
Submitted: 18 Aug 2006 22:50 Modified: 30 Nov 2018 3:17
Reporter: Ådne Hetlelid Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:4.1.21-win32 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[18 Aug 2006 22:50] Ådne Hetlelid
Description:
When using "group by ... with rollup" is usefull to determind which line is the "rollup" row and use it for rules.

I got checking of the "rollup" row but when I go to advanced rules it got a no working or bad result.

what about implementing "isrollup" like the "c1type" column in the sql script in the "How to Repeat" section.

How to repeat:
select c1,c2, if(ifnull(c1,0) = 0, null, c2) as c1c2, if(ifnull(c1,0) = 0, "Rollup", "Normal") as c1type
from (
  select 1 as c1, 0 as c2
union
  select 2, 1
union
  select 3, 0
union
  select 4, 1
union
  select 5, 0
union
  select 6, 1
union
  select 7, 0
) as aja
group by c1 with rollup
[24 Aug 2006 13:41] Valeriy Kravchuk
Thank you for a problem report. Sounds like a reasonable feature request for me. Oracle, for example, has functions to determine is row created "by rollup" or not.
[30 Nov 2018 3:17] Paul DuBois
Posted by developer:
 
GROUPING() function was implemented in 8.0.1. See:

https://dev.mysql.com/doc/refman/8.0/en/group-by-modifiers.html