Drop table if exists learning_new4;
Create Table learning_new4 (ID integer default 1 primary key autoincrement, sttile text, scontent text, sort text );
Insert into learning_new4 (sttile, scontent, sort) Select sttile, scontent, sort from learning_new3 order by sort DESC;
// Select some fields from the table and place them in a new table.
Drop table if exists fullnew;
Create Table fullnew (ID integer default 1 primary key autoincrement, stitle varchar (80), scontent memo, sort text );
Insert into fullnew (stitle, scontent, sort) Select field2, field3, field4 from learning_new4 order by field4 DESC;
// Create a new table from an existing table.
Drop table if exists duanxinleyuan;
Create Table duanxinleyuan (ID integer default 1 primary key autoincrement, stitle varchar (80), scontent memo );
Insert into duanxinleyuan (stitle, scontent) Select stitle, scontent from fullnew where ID between 1 and 59;
// Insert the row with the ID between 60 and 140 in fullnew to the end of the existing table.
Insert into duanxinleyuan (stitle, scontent) Select stitle, scontent from fullnew where ID between 60 and 140;
//
If you want to delete the id = 50 ~ 150 records between 100
// Delete row data
Delete from a where chapterid> 49 and chapterid <151
// Reverse orders from existing tables to generate new tables in descending order of IDS
Drop table if exists gui1__des;
Create Table gui1__des (ID integer default 1 primary key autoincrement, stitle varchar (80), scontent memo );
Insert into gui1__des (stitle, scontent) Select stitle, scontent from Guihua order by id desc;