日期:2014-05-17 浏览次数:20834 次
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 , ???
select code, wcname, (SELECT COUNT(1) from table2 WHERE table2.id = x.id) totalCount
from (SELECT a.id id, a.code code , WMSYS.WM_CONCAT(a.name) wcname,
from table1 a where a.id=82 group by a.id, a.code ) x