The SQL Features I Suggested (And Oracle Implemented) — Part 2: GROUP BY ALL

THE SAGA: “The Features I Suggested, Oracle Implemented — A Personal History”

This is a five-part series about two Oracle SQL features introduced in Oracle Database 23ai that are strikingly similar — in concept, motivation, and syntax — to suggestions I posted in the Oracle Community forums in July 2016, nearly a decade before they were implemented.

On July 2, 2016, I posted an idea to the Oracle Community Database Ideas forum. The title was “SQL Syntax: GROUP BY OTHERS”.

Here’s the core of what I proposed:

“So, to make it simpler, it could exists a ‘GROUP BY OTHERS’ that group all selected columns that are not under aggregate functions.”

I demonstrated it with this example:

SELECT COUNT(*), SUM(salary), AVG(salary), AVG(age),
       company, state, country
FROM company_employees
GROUP BY OTHERS;

My point was clear: developers shouldn’t have to repeat every non-aggregated column in the GROUP BY clause. The database should be smart enough to infer it. I even acknowledged that the keyword didn’t have to be OTHERS — I mentioned GROUP BY all, GROUP BY everythingelse, among others. The idea was the important part.

In Oracle 23ai (released May 2024), the feature landed as GROUP BY ALL. The syntax:

SELECT COUNT(*), SUM(salary), AVG(salary), company, state, country
FROM company_employees
GROUP BY ALL;

The motivation is identical. The behavior is identical. The keyword ALL was one of the alternatives I explicitly mentioned in a comment on my own post.

I’m not saying this proves Oracle implemented my idea. What I’m saying is that the timing of my suggestion — 2016 — and the implementation — 2024 — represents roughly an eight-year gap, during which the Oracle Ideas forum was maintained by Oracle’s product management team. These ideas were read. They were evaluated. And this particular one was implemented.

A credit in the documentation would have been appropriate. In my opinion, it still would be.

Link to my original 2016 post: https://forums.oracle.com/ords/apexds/post/sql-syntax-group-by-others-0435

Discover more from grepOra

Subscribe now to keep reading and get access to the full archive.

Continue reading