Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- recreate log_mpe table
- create table log_mpe_2 like log_mpe;
- -- insert last record in log_mpe to new log_mpe table
- insert into log_mpe_2
- select *
- from log_mpe l1
- where id = (
- select max(l2.id)
- from log_mpe l2
- );
- -- rename table, subsequent inserts will go to new log_mpe table
- -- and use the next higher id
- rename table log_mpe to log_mpe_orig, log_mpe_2 to log_mpe;
- -- insert remaining records from original log_mpe table
- insert into log_mpe
- select *
- from log_mpe_orig lo
- where id < (
- select min(lo.id)
- from log_mpe l1
- );
Advertisement
Add Comment
Please, Sign In to add comment