sql从开始删除
答
CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
-- if this is 41st record, ...
-- the statement below will delete the id with 1, and so forth
insert into animals(name) values('wolverine');
delete from animals where id <= LAST_INSERT_ID() - 40;
您正在使用哪个数据库? (Oracle,MySQL,SQL Server,...) – Andomar 2010-05-29 15:00:18
我正在使用MYSQL – sark9012 2010-05-29 15:02:17