I'm trying to execute the next query:
SELECT
PROMO_PLAN.promo_plan_id,
PROMO_PLAN.promo_plan_name,
PROMO.promo_category_code,
PROMO.promo_id,
PROMO.allow_plan_code,
PROMO_PLAN.event_type_code,
( SELECT
NVL(PROMO_MAX_TIMING_DURATION_VW.duration, 900)
FROM
promo_max_timing_duration_vw
WHERE
PROMO_PLAN.promo_plan_id = PROMO_MAX_TIMING_DURATION_VW.promo_plan_id)
AS duration,
PROMO_PLAN.start_date,
PROMO_PLAN.end_date,
PROMO_PLAN.day_type_id
FROM
promo_plan,
promo
WHERE
PROMO_PLAN.promo_plan_id <> -1
AND PROMO_PLAN.promo_id = PROMO.promo_id
AND PROMO_PLAN.promo_plan_id = 18150
AND '27/09/2012' BETWEEN PROMO_PLAN.start_date AND PROMO_PLAN.end_date
AND (PROMO_PLAN.day_type_id = 1307001
OR PROMO_PLAN.day_type_id = -1)
AND (PROMO_PLAN.promo_target_id = -1
OR EXISTS (
SELECT
1
FROM
promo_plan_channel
WHERE
PROMO_PLAN_CHANNEL.promo_plan_id = PROMO_PLAN.promo_plan_id
AND PROMO_PLAN_CHANNEL.channel_id = 10829))
and I get the error message : ORA-01427: single-row subquery returns more than one row
I tried to change the last sub-query and it changed nothing.
can someone tell me how to fix it?
thanks
homework
tag. – Bob Jarvis - Reinstate Monica