select
b.no, a.name as agent_name, c.name as shipper_name
from
tableb as b
left join
tablea as a on b.agent_id = a.id
left join
tablea as c on b.shipper_id = c.id
select
b.no, a.name as agent_name, c.name as shipper_name
from
tableb as b
left join
tablea as a on b.agent_id = a.id
left join
tablea as c on b.shipper_id = c.id
yejr
周二, 2008/08/12 - 09:40
Permalink
参见手册的 LEFT JOIN
参见手册的 LEFT JOIN 语法
MySQL方案、培训、支持
游客 (未验证)
周二, 2008/08/12 - 11:12
Permalink
select b.no, a.name as
select
b.no, a.name as agent_name, c.name as shipper_name
from
tableb as b
left join
tablea as a on b.agent_id = a.id
left join
tablea as c on b.shipper_id = c.id
libftx
周二, 2008/08/12 - 17:12
Permalink
测试通过! 谢谢回复!
测试通过!
谢谢回复!
游客 (未验证)
周二, 2008/08/12 - 11:13
Permalink
select b.no, a.name as
select
b.no, a.name as agent_name, c.name as shipper_name
from
tableb as b
left join
tablea as a on b.agent_id = a.id
left join
tablea as c on b.shipper_id = c.id