Hi all,
I have a requirement like I have to select IP for a particular Employee Number. If the IP is null then I want every IP from a different table.
I created the following statement for understanding.
select
case when (select
ip_main_id
from "SPEND"."FACT_DATA_EXCEPTIONS_TMX"
where employee_number = '583853') is not null
then (select
ip_main_id
from "SPEND"."FACT_DATA_EXCEPTIONS_TMX"
where employee_number = '583583')
else (select
iou
from "_SYS_BIC"."Spend/CV_CLAIMS_TREND_DASHBOARD_IOU" )
end
from dummy
But I am getting error as
"
Could not execute 'select case when (select ip_main_id from "SPEND"."FACT_DATA_EXCEPTIONS_TMX" where employee_number = ...' in 1.041 seconds .
SAP DBTech JDBC: [305]: single-row query returns more than one row:"
Because "_SYS_BIC"."Spend/CV_CLAIMS_TREND_DASHBOARD_IOU" contains more than one IOU.
Is there any way I can create the above query in HANA or create a procedure.
Regards,
Nakul Kothari
+919987039379