当前位置: 代码迷 >> Sql Server >> 这样的sql联接语句如何写
  详细解决方案

这样的sql联接语句如何写

热度:4   发布时间:2016-04-27 20:30:14.0
这样的sql联接语句怎么写?
select   laowu.name,sb_feerecord.ygid,sb_feerecord.Sb_Month,
Sb_YanLao_Unit,Sb_LosJob_Unit,gzjb_ID_Unit  
    from   laowu,sb_feerecord,gzjb  
    where   laowu.id=sb_feerecord.ygid  
        and   laowu.id=gzjb.ygid
        and   gzjb.id=sb_feerecord.gzjb_ID_Unit

select   laowu.name,sb_feerecord.ygid,sb_feerecord.Sb_Month,
Sb_YanLao_Per,Sb_Medcal_Per,gzjb_ID_Personl
    from   laowu,sb_feerecord,gzjb  
    where   laowu.id=sb_feerecord.ygid  
        and   laowu.id=gzjb.ygid
        and   gzjb.id=sb_feerecord.gzjb_ID_personl

查询出的这个两个表如果要用两个表的ygid关联,应该怎么写.

------解决方案--------------------
select * from
(第一句)aa
Inner Join
(第二句)bb
On aa.ygid=bb.ygid
  相关解决方案