日期:2014-05-16 浏览次数:20664 次
CREATE TEMPORARY TABLE seqnumber ( id int not null auto_increment primary key, flag bit ) auto_increment=471 ENGINE=MEMORY; INSERT INTO seqnumber(flag) SELECT 0 FROM information_schemas.COLUMNS LIMIT 70; CREATE TEMPORARY TABLE tmp_tb ENGINE=MEMORY AS SELECT A.id,'username' AS username FROM seqnumber AS A LEFT JOIN tb AS B ON A.id=B.id WHERE B.id IS NULL; INSERT tb(id,username) SELECT * FROM tmp_tb;