Search notes:

ORA-22818: subquery expressions not allowed here

create table tq84_ora_22818_test (a number);

begin
   insert into  tq84_ora_22818_test values (1   );
   insert into  tq84_ora_22818_test values (2   );
   insert into  tq84_ora_22818_test values (null);
end;
/
The following statement throws ORA-00937: not a single-group group function:
select
   count(a)                                               cnt_a,
  (select count(*) from tq84_ora_22818_test where a = 1)  cnt_a_1
from
   tq84_ora_22818_test;
The following statement throws ORA-22818: subquery expressions not allowed here
select
   count(a)                                               cnt_a,
  (select count(*) from tq84_ora_22818_test where a = 1)  cnt_a_1
from
   tq84_ora_22818_test
group by
  (select count(*) from tq84_ora_22818_test where a = 1);

drop table tq84_ora_22818_test;
Subqueries are not allowed to provide the value for a default column:
create table tq84_p (
   id  number primary key,
   cnt number  default (select count(*) from tq84_p)
);

See also

Subqueries
Other Oracle error messages

Index