troubleshooting Question

Left join?

Avatar of steven
stevenFlag for United States of America asked on
SQL
3 Comments1 Solution41 ViewsLast Modified:
we are trying to pull all locations from the PA1 that have containers, so this query seems to work, problem is that there are locations that DON't have a container, so we need to pull those also.  Why will the below not work. PLease help we need this asap.





select i.whse,i.loc,ct.container_num, i.item,it.description, case when c.qty_contained is null then qty_on_hand else c.qty_contained end as qty
from  itemloc_mst i
      inner join item_mst it on it.item = i.item
      left outer join container_item_mst c on c.item = i.item
      left outer join container_Mst ct on ct.container_num = c.container_num and ct.whse = i.whse
where i.qty_on_hand > 0
and i.whse ='pa1' and ct.whse = 'pa1'
and i.loc like '20I01%'
and c.item is null
order by i.loc desc
ASKER CERTIFIED SOLUTION
steven
developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros