GROUP BY clause
Some databases allow you to specify a column index in the GROUP
BY clause:
SELECT a, b, sum(c) FROM table GROUP BY 1,2
This is not possible with all database servers:
Database Server Type | GROUP BY colindex, ... ? |
---|---|
IBM® Informix® | Yes |
Microsoft™ SQL Server | No |
Oracle® MySQL / MariadDB | Yes |
Oracle Database Server | Yes, since Oracle 23ai See
|
PostgreSQL | Yes |
SAP HANA® | No |
SQLite | Yes |
Dameng® | No |
Search for GROUP BY in your SQL statements and use explicit column names.