--- Create Template Table ---
DROP TABLE MY_BACKUP;
CREATE TABLE MY_BACKUP(
person_id INTEGER PRIMARY KEY AUTOINCREMENT,
my_link TEXT,
my_state CHAR(15),
my_name TEXT,
record_state INT,
time_stamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Insert into MY_BACKUP(my_link, my_state, my_name, record_state)
Select my_link, my_state, my_name, record_state
From my_link_db;
select * from MY_BACKUP;
--- Add TIMESTAMP to My Current Table and Copy Data from Template Table ---
DROP TABLE my_link_db;
CREATE TABLE my_link_db(
person_id INTEGER PRIMARY KEY AUTOINCREMENT,
my_link TEXT,
my_state CHAR(15),
my_name TEXT,
record_state INT,
time_stamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Insert into my_link_db(my_link, my_state, my_name, record_state)
Select my_link, my_state, my_name, record_state
From MY_BACKUP;
--- DROP Template Table -------------------------------
DROP TABLE MY_BACKUP;
0 意見:
張貼留言