Sql server inner join......on
--查询的时候,如果表中有重名的列,此时,应该在通过 表名.列名 的方式来限定指定的列是哪张表中的。
select
PhoneNum.pid,
PhoneNum.pname,
PhoneNum.pcellphone,
PhoneType.ptname
from PhoneNum inner join PhoneType on PhoneNum.ptypeid=PhoneType.ptid
--查询的时候为表起别名
select
pn.pid,
pn.pname,
pn.pcellphone,
pt.ptname
from PhoneNum as pn inner join PhoneType as pt on pn.ptypeid=pt.ptid
inner join .... on ...
inner join ... on ...
------------------------------
select * from TblPerson