首页 > 代码库 > sql语句,多个表之间,通过相同内容字段的联合查询

sql语句,多个表之间,通过相同内容字段的联合查询

1 , select j.id,
         jt.Name,
        j.ApproveType ,
         j.ProductCode,
         j.CustomerCode,
         u.FullName,
         jf.Name as jfName,
         j.ExpectedTime
   from JudgeOrder as j
  join JudgeOrderType as jt  on j.JudgeType=jt.Id
  join [User] as u on j.SalesManCode=u.Name
  join JudgeOrderFormat as jf on j.FormatType=jf.id order by j.Id

 

核心就是:tableName1 as tName1 join tableName2 as tName2 on tName1.xxx = tName2.xxx

             通俗易懂!

sql语句,多个表之间,通过相同内容字段的联合查询