多个left join 不在access 和sql的写法是不同的 如
ACCESS
select g.ccbh,g.jyrq,g.[10IB老化后],g.[033IB老化后],g.[05LIB老化后],h.[05L02IB老化后] from (select e.ccbh,e.jyrq,e.[10IB老化后],e.[033IB老化后],f.[05LIB老化后] from
( select d.ccbh,d.jyrq,d.[10IB老化后],b.[033IB老化后] from
(
SELECT a.ccbh,a.JYRQ,c.WCPJ as [10IB老化后] FROM DBCS a
left join (
select WCPJ,jh,jyrq from jbwc where glys ='1.0' and IB='IB'
) c on a.ccbh=c.jh and format( a.jyrq,'yyyy-mm-dd')=format( c.jyrq,'yyyy-mm-dd')
) d
left join (
select WCPJ as [033IB老化后],jh,jyrq from jbwc where glys ='1.0' and IB='0.033Ib'
) b on d.ccbh=b.jh and d.jyrq=b.jyrq
) e
left join (
select WCPJ as [05LIB老化后],jh,jyrq from jbwc where glys ='0.5L' and IB='IB'
) f on e.ccbh=f.jh and e.jyrq=f.jyrq
) g
left join (
select WCPJ as [05L02IB老化后],jh,jyrq from jbwc where glys ='0.5L' and IB='IB'
) h
on g.ccbh=h.jh and g.jyrq=h.jyrq
SQL
SELECT a.ccbh,a.JYRQ,b.033IB老化后,f.05LIB老化后,h.05L02IB老化后,c.WCPJ as 10IB老化后 FROM DBCS a
left join (
select WCPJ,jh,jyrq from jbwc where glys ='1.0' and IB='IB'
) c on a.ccbh=c.jh and format(a.jyrq,'yyyy-mm-dd')=format(c.jyrq,'yyyy-mm-dd')
left join (
select WCPJ as 033IB老化后,jh,jyrq from jbwc where glys ='1.0' and IB='0.033Ib'
) b on a.ccbh=b.jh and a.jyrq=b.jyrq
left join (
select WCPJ as 05LIB老化后,jh,jyrq from jbwc where glys ='0.5L' and IB='IB'
) f on a.ccbh=f.jh and a.jyrq=f.jyrq
left join (
select WCPJ as 05L02IB老化后,jh,jyrq from jbwc where glys ='0.5L' and IB='IB'
) h on a.ccbh=h.jh and a.jyrq=h.jyrq