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

             通俗易懂!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM