select scno from ys_stkscase
where scno in(select forsobunsmandesc from ys_stkscase where scno in(select scno from ys_stksmoved where smno=5686852993763015071))
我只会这样写,
请帮忙用inner join写
where scno in(select forsobunsmandesc from ys_stkscase where scno in(select scno from ys_stksmoved where smno=5686852993763015071))
我只会这样写,
请帮忙用inner join写
select scno from ys_stkscase as ys
where exists (
select forsobunsmandesc from ys_stkscase
where exists (select scno from ys_stksmoved where scno=ys_stkscase.scno smno=5686852993763015071) and
ys.scno=forsobunsmandesc
)
select a.scno
from ys_stkscase a join ys_stkscase b on a.scno = b.forsobunsmandesc
join ys_stksmoved c on a.scno = c.scno
where c.smno=5686852993763015071