sql多表查询
常用的多表联合查询的sql语句:
select spkfjc.*,spkfk.* from spkfjc inner join spkfk on spkfjc.spid=spkfk.spid
where spkfjc.spid='SPH00000078'
改进后:
select a.ID from table1 a,
(select col1,ID from table2 where col2='xxx') b
where a.ID=b.ID
常用的多表联合查询的sql语句:
select spkfjc.*,spkfk.* from spkfjc inner join spkfk on spkfjc.spid=spkfk.spid
where spkfjc.spid='SPH00000078'
改进后:
select a.ID from table1 a,
(select col1,ID from table2 where col2='xxx') b
where a.ID=b.ID