I have this minimal example in Oracle DB
create table a (name varchar2(10));
create table b (x number, y number);
and I wish to do this
select (select name from a where rownum <=1), sum(x) from b;
but I get
ORA-00937: not a single-group group function
How can I get the result I want, that is, name from table a and sum from b?
Edit (add example)
Table A
name
=====
foo
bar
Table B
x y
=======
1 2
10 20
Should give
foo 11
x
values fromb
related or joined to thename
values froma
? Or do you simply want a one-row answer with the firstname
and the sum of allx
’s? Please show two small tables as example input and the expected output table.