select * from xinxi where cityId in (select id from city  sid=sid)

解决方案 »

  1.   

    select * from sheng a left join city b on a.sid=b.sid left join xinxi c on b.cityId = c.cityId  where a.sname='xxx';
      

  2.   

    select * from sheng a 
    left join city b on a.sid=b.sid 
    inner join xinxi c on b.cityId = c.cityId  where a.sname='xxx';
      

  3.   

    select * from xinxi
    where cityId in(
          select b.cityId from sheng a
          left join city b on a.sid=b.sid
          where a.sname='xxx')