Help on getting around the error : Not a single-group group function.
The inner queries works. Can you help with my error?
When I run this in Toad, it highlights the sub1 as issue and I have tried different things but it still give me same error.
Thank you
select sub2.point_id, sub2.total_released
FROM
(select sub1.POINT\_ID, sum(sum(nvl(sub1.Release,0)) - sum(nvl(sub1.Recall,0))) as total\_released
FROM (
select d.pointid\_b as POINT\_ID,
d.release\_qty\_a as Release,
r.recall\_qty as Recall
from capacity\_release\_Change c JOIN capacity\_release\_change\_Detail d
ON d.cp\_release\_seq = c.cp\_release\_Seq
LEFT JOIN capacity\_release\_recall r
ON d.cp\_release\_detail\_seq = r.cp\_release\_detail\_seq
where c.r\_start\_date >= to\_date ('5/10/2020','mm/dd/yyyy') and c.r\_end\_date \<= to\_date ('5/31/2020','mm/dd/yyyy') ) sub1
--and d.pointid\_b = 1006227
group by sub1.point\_id, sub1.Release, sub1.Recall) sub2
group by sub2.point_id
This is the result set from sub1:
