다음 쿼리가 있습니다. 나는 다른 테이블에 합류하기를 바라고 있습니다. 나는 쿼리가 값을 반환해야한다는 사실을 알고 있지만 값은 null로 돌아오고있다. 누구든지 내가 잘못하고있는 것을 본 사람이 있습니까? 이 시점에서 뇌가 튀었습니다. 일치가없는 경우 좌측 외측 가입왼쪽 조인에서 Null 값 가져 오기
SELECT
ss.NDC,
ss.ShipToAddressNo,
ss.QuantityShipped,
c.AccrualType,
ss.ExtendedPrice ExtendedPrice,
c.AccrualAmount CBAccrualAmount
FROM
SalesSummary ss left join ChargebackAccruals c on
ss.ClassOfTrade = c.TradeClass and
c.AddressNo is null and
c.ShipTo is null and
c.ShortItemNo is null and
c.LotNumber is null and
ss.InvoiceDate = @RunDate and
ss.InvoiceDate between AccrualBeginDate and AccrualEndDate
문제가있는 샘플 데이터 세트를 제공해 주시겠습니까? – Taemyr