I have the following query:
SELECT
one.b ,
one.c,
two.d,
two.e,
two.f
FROM
(SELECT
a,
b,
c
FROM tablea
LEFT JOIN tableb
ON tableb.pkey= tablea.pkey
WHERE tablea.variable_in_commun= {{variable_in_commun}}) AS one
FULL JOIN
(SELECT
a,
d,
e,
f
FROM tablec
LEFT JOIN tabled
ON tabled.key= tablec.key
WHERE tablec.variable_in_commun= {{variable_in_commun}}
) AS two
on one.a= two.a
My problem is: I want variable_in_commun to have the same value in queries one and two. Can I do this? as soon as I did, I would need two filters for the query to work. variable_in_commun must be given a date range (eg 30 days).