w SELECT 原理。
1 SELECT * FROM wz WHERE CONCAT(wint,wchar) NOT IN (SELECT CONCAT(wint,wchar) FROM wa); 2 SELECT * FROM wz WHERE CONCAT(wint,wchar) IN (SELECT CONCAT(wint,wchar) FROM wa);
1 TRUNCATE wz; 2 INSERT INTO wz SELECT * FROM wa WHERE id>14; 3 INSERT INTO wz SELECT * FROM wb WHERE id<9; 4 INSERT INTO wz SELECT * FROM we WHERE id>10 AND id<15; 5 UPDATE wz SET wchar=CONCAT(wint,'wz'); 6 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM wa WHERE id>14; 7 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM wb WHERE id<9; 8 INSERT INTO wz(wint,wchar) SELECT wint,wchar FROM we WHERE id>10 AND id<15; 9 10 11 12 13 UPDATE wa SET wint=id+100; 14 UPDATE wa SET wint=id+4444,wchar=CONCAT(wint,'wa'); 15 DELETE FROM wa WHERE id>16; 16 17 UPDATE wb SET wint=id+1000; 18 UPDATE wb SET wchar=CONCAT(wint,'wb'); 19 DELETE FROM wb WHERE id>16; 20 21 UPDATE we SET wint=id+10000; 22 UPDATE we SET wchar=CONCAT(wint,'we'); 23 DELETE FROM we WHERE id>16;
wz
id wint wchar
15 115 115wz
16 116 116wz
1 1001 1001wz
2 1002 1002wz
3 1003 1003wz
4 1004 1004wz
5 1005 1005wz
6 1006 1006wz
7 1007 1007wz
8 1008 1008wz
11 10011 10011wz
12 10012 10012wz
13 10013 10013wz
14 10014 10014wz
17 115 115wa
18 116 116wa
19 1001 1001wb
20 1002 1002wb
21 1003 1003wb
22 1004 1004wb
23 1005 1005wb
24 1006 1006wb
25 1007 1007wb
26 1008 1008wb
27 10011 10011we
28 10012 10012we
29 10013 10013we
30 10014 10014we