先做原表備份
CREATE TABLE A_1 AS SELECT * FROM A WHERE aa IN ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
CREATE TABLE B_1 AS SELECT * FROM B WHERE aa IN ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
CREATE TABLE C_1 AS SELECT * FROM C WHERE aa IN ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
CREATE TABLE D_1 AS SELECT * FROM D WHERE aa IN ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
CREATE TABLE E_1 AS SELECT * FROM E WHERE aa IN ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
........
在做原表數據刪除
delete FROM A where aa in ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
delete FROM B where aa in ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
delete FROM C where aa in ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
delete FROM D where aa in ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
delete FROM E where aa in ('eimdmc','30mdnci','cienc03','39n33ndc','c035mcie','cnencc0394','cnednc003','ciiencec004','cinendnc00','2098472bnc','cnenndcj93','398473c3d','cjbebcencc','397c73becu','393knencne','398883jjdnc','83737jecnd','398838cjebc','e993nndn3','dii3nndn','300993983d');
........
這兩個組的語句中 in 後面都有很長的參數,而且都是完全一樣的。
怎麼能夠用參數替代這個in之後的語句。
希望使用簡單sql
是的,講這些數據放到一張表裡,然後 select * from xxx where 字段 in (select 字段 from tablexxxx)