转换前查询
SELECT w.tech AS tech,
w.wpcddate AS job_date,
w.corp AS corp,
w.house AS house_number,
w.cust AS cust_number,
h.zipcode AS zipcode
FROM fsm_m_wipmaster w,
fsm_m_zipmaster z,
fsm_m_housemaster h,
fsm_m_custmaster c
WHERE c.corp(+) = w.corp
AND c.house(+) = w.house
AND c.cust(+) = w.cust
AND h.corp(+) = w.corp
AND h.house(+) = w.house
AND h.cust(+) = w.cust
AND z.corp(+) = w.corp
AND z.zipbeg IS NULL
AND h.zipcode IS NOT NULL
AND w.tech IS NOT NULL
ORDER BY w.corp;
转换后查询
SELECT w.tech AS tech,
w.wpcddate AS job_date,
w.corp AS corp,
w.house AS house_number,
w.cust AS cust_number,
h.zipcode AS zipcode
FROM fsm_m_housemaster h
LEFT OUTER JOIN
fsm_m_custmaster c
ON h.cust = c.cust
AND h.corp_seq = c.corp_seq
AND h.house = c.house
LEFT OUTER JOIN
fsm_m_wipmaster w
ON h.cust = w.cust
AND h.house = w.house
AND h.corp_seq = w.corp_seq
LEFT OUTER JOIN fsm_m_zipmaster z
ON h.corp_seq = z.corp_seq AND z.zipbeg IS NULL
WHERE w.tech IS NOT NULL
ORDER BY w.corp;
我似乎对为什么转换后的查询没有返回与之前的查询相同的结果。我知道我在这里遗漏了一些愚蠢的东西有人能发现明显的吗?