Comments - SELECT WITH ROLLUP

4 years, 9 months ago Frits Nagtegaal

It would be helpfull if the GROUPING() function was available to replace the NULLS

 
2 years, 10 months ago Claudio Nanni

Hello Frits, In absence of that you may use a workaround. Wrap the query in a SELECT COALESCE(Country, 'All Countries'),COALESCE(year,'All Years),COALESCE(genre,'All Genred') FROM (.....) AS T;

 
1 year ago David Hillman

Claudio,

That's not much of a workaround, since coalesce is a completely different operation which leads to incorrect results. Specifically, coalesce fails to differentiate between nulls in data and nulls generated by the roll up. Coalesce also cannot be used in a having clause.

MariaDB desperately needs to add the grouping function, as common queries are not possible to write correctly without it.

 
1 year ago Ian Gilfillan

No issue had been created for this - I've created MDEV-32789 - please vote and or comment if you think the issue will be helpful.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.