Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am using Postgres. I am trying to execute two functions in PARALLEL, and then union their results - here is my code so far
I am using Postgres. I am trying to execute two functions in PARALLEL, and then union their results here is my code so far which throws the following error SQL Error P: ERROR: current transaction is aborted, commands ignored until end of transaction block begin;
WITH areaids AS
SELECT DISTINCT "areaID"::character varying
FROM campaignscope cs
WHERE BETWEEN cs"campaignStartDate" AND cs"catchupEndDate"
areaidcounts AS
SELECT COUNT AS totalcount
FROM areaids
selectedareaids AS
SELECT "areaID"::character varying,
ROWNUMBER OVER ORDER BY "areaID"::character varying AS rownum
FROM areaids
results as
SELECT inter. FROM
select from public.interactionsloopeducmoaicarraySELECT selectedareaids."areaID"::character varying
FROM selectedareaids
JOIN areaidcounts ON true
WHERE selectedareaids.rownum areaidcounts.totalcount
::::
order by areaidparentimei,childimei,parentpingtime as inter
results as
SELECT inter. FROM
select from public.interactionsloopeducmoaicarraySELECT selectedareaids."areaID"::character varying
FROM selectedareaids
JOIN areaidcounts ON true
WHERE selectedareaids.rownum areaidcounts.totalcount
::::
order by areaidparentimei,childimei,parentpingtime as inter
SELECT FROM result
UNION ALL
SELECT FROM result;
commit;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started