GROUP BY ALL in Oracle Database 23ai/26ai
Oracle database 23ai/26ai (23.9) introduces the ALL keyword to simplify the GROUP BY clause.
oracle 23configurationintermediate
by OracleDba
13 views
Oracle database 23ai/26ai (23.9) introduces the ALL keyword to simplify the GROUP BY clause.
12345678910
conn sys/SysPassword1@//localhost:1521/freepdb1 as sysdba
drop user if exists testuser1 cascade;
create user testuser1 identified by testuser1 quota unlimited on users;
grant db_developer_role to testuser1;
grant alter session to testuser1;
conn testuser1/testuser1@//localhost:1521/freepdb1
create table t1 as select * from all_objects;1234567891011
column owner format a30
select owner, object_type, status, count(*)
from t1
group by owner, object_type, status
order by 1, 2;
select owner, object_type, status, count(*)
from t1
group by all
order by 1, 2;123456789101112131415161718192021222324252627282930313233
conn sys/SysPassword1@//localhost:1521/freepdb1 as sysdba
alter system flush shared_pool;
conn testuser1/testuser1@//localhost:1521/freepdb1
set linesize 100
column value format a60
select value
from v$diag_info
where name = 'Default Trace File';
VALUE
------------------------------------------------------------
/opt/oracle/diag/rdbms/free/FREE/trace/FREE_ora_18005.trc
SQL>
alter session set events '10053 trace name context forever';
select owner, object_type, status, count(*)
from t1
group by all
order by 1, 2;
alter session set events '10053 trace name context off';
Final query after transformations: qb SEL$1 (#1):******* UNPARSED QUERY IS *******
SELECT "T1"."OWNER" "OWNER","T1"."OBJECT_TYPE" "OBJECT_TYPE","T1"."STATUS" "STATUS",COUNT(*) "COUNT(*)"
FROM "TESTUSER1"."T1" "T1"
GROUP BY "T1"."OWNER","T1"."OBJECT_TYPE","T1"."STATUS"
ORDER BY "T1"."OWNER","T1"."OBJECT_TYPE"Please to add comments
No comments yet. Be the first to comment!