SELECT a.code, WMSYS.WM_CONCAT(a.name),
(SELECT COUNT(*) from table2 WHERE table2.id = a.id) as totalCount
from
table1 a
where a.id=82
group by a.code , ???
里面使用了WMSYS.WM_CONCAT,必须得gourp by 一下,code到可以,但“totalCount”怎么办呢,我直接写
group by a.code , totalCount
要报错[Err] ORA-00904: "STUDENTCOUNT": invalid identifier
gourpby后不跟totalCount 又要写[Err] ORA-00979: not a GROUP BY expression