LeighDreyer
Programmer
Hi I am trying to update multiple rows from one table but keep getting the error "ORA-01427: single-row subquery returns more than one row" how can I do it here is my code statement I am trying
UPDATE GPCT_PIMS.GPCT_WARDCOUNT SET (MALE_UNDER_65) =
(SELECT COUNT(REF_DATE) AS "MALE_UNDER_65"
FROM GPCT_PIMS.GPCT_WARDCOUNT
WHERE SEX = 'M'
AND
OVER_65 = 'N'
GROUP BY WARD_NAME,
REF_DATE,
SEX,
OVER_65)
UPDATE GPCT_PIMS.GPCT_WARDCOUNT SET (MALE_UNDER_65) =
(SELECT COUNT(REF_DATE) AS "MALE_UNDER_65"
FROM GPCT_PIMS.GPCT_WARDCOUNT
WHERE SEX = 'M'
AND
OVER_65 = 'N'
GROUP BY WARD_NAME,
REF_DATE,
SEX,
OVER_65)