SELECT distinct code FROM Stoke where Bigcode in (select Opencode from AppStoke)
SELECT distinct code FROM Stoke A where exists (select 1 from AppStoke B WHERE B.Opencode=A.Code)
in用extist代替
select distinct * from Stoke where Code not in (select Code From AppStoke) select distinct * from Stoke A where not EXISTS (select 1 From AppStoke B WHERE B.OpenCode=A.Code)
not in 用 not extist 代替
Update SCALE set State='已入库' WHERE Code in (select OpenCode from AppStore) Update SCALE set State='已入库' WHERE EXISTS (select 1 from AppStoreS WHERE S.OpenCode=Code)