3
$\begingroup$

Hello I have done this full join query:

SELECT
  F.date AS Campaign_Date,
  F.Store AS AS Campaign_Store,
  F.IMPRESSIONS,
  F.CLICKS,
  F.SPEND,
  C.Date AS visitors_Date,
  C.ANNEE_MOIS,
  C.ANNEE,
  C.MOIS,
  C.Store AS visitors_Store,
  C.FREQUENTATION_Store
FROM
  `project.campaigns`  F
FULL JOIN
  `proiject.visitors` C
ON (
  C.Store= F.Store
  AND C.Date =F.date
  )

And now, I want to retireve that values of column FRQ_Store that never matched any of those Campaign_Store ! In other words, how can I retrieve all the value of two columns that never matched in a full join query ?

Thank you!

$\endgroup$

1 Answer 1

1
$\begingroup$

What you appear to want is a left outer join on NULL, this will give you only the rows of the left table which do not have a match with the right table:

SELECT    F.Store
FROM      `project.campaigns`  F
LEFT JOIN `project.visitors`   C
ON (
      F.Store = C.Store
  AND F.Date  = C.Date
  )
WHERE C.Store IS NULL

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.