我有一个查询问题,例如这个我可以检索记录:
SELECT
l.*,
ll.f_cocacola as cocacola,
le.name AS deposit,
lp.price
FROM
KPC AS l,
KPC_cocacola AS ll,
KPC_deposit AS le,
KPC_price AS lp
WHERE
l.cod_deposit = le.id_deposit
AND l.code = ll.code
AND lp.code = l.code
AND l.code_deposit = '002365'
但现在我需要包含另一个表中的另一个日期 -intranet- 具有字段code和url然后需要从这个表中显示url字段.. 请记住,关系在code字段上。
所以我以这种方式更改查询:
SELECT l.*,ll.f_cocacola as cocacola, le.name AS deposit,
lp.price, lintranet.url
FROM tableX AS l, intranet_cocacola AS ll, tableX_deposit AS le,
tableX_price AS lp,
tableX_intranet as lintranet
WHERE l.code_deposit = le.id_deposit
AND l.code = ll.code
AND lp.code = l.code
AND l.code = lintranet.code
AND l.code_deposit = '456852147'
但问题是某些记录没有url,如果不存在url,那么这个查询不会向我显示记录.. 即使没有与我想要的记录关联的url ,我也需要它看到那个记录,谢谢