1

I have a query (Query A) that pulls data from my Customer table. I have another query (Query B) that pulls data from a list of records associated with various customers. - Every customer on Query B exists on Query A….but not every customer on Query A has a record on Query B

What I’m trying to do is to take 1 field from Query B, and pull it into Query A….but when I do that, it essentially limits the entire scope of Query A to only those customers present on Query B.

Is there a way that I can have Query A display it’s full list of customers, with a column next to it that displays data from Query B only if there is data on Query B?

I hope I’m making sense!

1 Answer 1

2

You need to use a LEFT JOIN to get all of QueryA and whatever records exist for QueryB

SELECT * FROM QueryA as A LEFT JOIN QueryB as B on A.columnid=B.columnid
1
  • That is perfect, thank you so much! Far far easier than I was expecting!!
    – JRP
    Commented Sep 1, 2017 at 20:00

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.