我有这个表:从多个表中的电话号码获取姓名?
inbox table
SenderNumber Message
contact table
Name Number
district table
id SpvName Number
sub_district table
id district_id SpvName Number
village table
id sub_district_id SpvName Number
我想从接触,区,sub_district或村庄,从收件箱中的SenderNumber列基于名称或spvname。我如何实现这一目标?结果这
SenderNumber | Name | Type | Message
-------------+------+--------------+------------
123 | john | contact | bla bla
234 | mary | district spv | bla bla bla
在此先感谢和抱歉我的英文不好,也许等。
谢谢,这是我需要的,但是,我不知道我们如何使它更快吗?查询大概需要0.780秒。我有这些数量的每个表的记录: 收件箱:227 接触:36 区:11 sub_district:154 村:1767个 – dieehard 2011-04-19 10:03:01