Hello, I am struggling with finding a solution to perform two separate sub-queries and combining/returning the results similar to the CALL { } here and under section 3.16.2 here, but with differing columns between the sub-queries.
I'm using Browser Neo4j 4.3 Desktop Edition.
My example query is:
CALL {
OPTIONAL MATCH (p:Person)-[v:VISITED]->(f:Farm {farmID:"B1"})
WHERE date(v.date) >= date('2020-3-27') AND date(v.date) <= date('2020-4-7')
RETURN DISTINCT p.personID, v.date, v.reason, f.farmID
UNION
OPTIONAL MATCH (p:Person)-[j:JOB_IS]->(f:Farm {farmID:"B1"})
RETURN p.personID, j.role as job_role
}
RETURN p.personID, j.role as job_role, v.date AS visit_date, v.reason as visit_reason, f.farmID
What I am hoping to get out of the query is something like the following, including nulls when a record isn't found: