简体   繁体   中英

How to use insert, update, delete query in sql at same time?

Just stuck up, how to use multiple query in single form to execute different query.

eg:

在此处输入图片说明 Like in image, Table 1 has records.

what i am doing is:

extract first 3 record from table 1 and show in a form (frontend) and when this process is gone..

i need at same time , this happens without refresh and without user data or any frontend disturbance.

Once this data view to user:

i need:

same time, those 3 records get copy to table 2 from table 1. like Roll_no and Name.

Then, remove those 3 records from table 1.

i am doing this to prevent duplicate data and something.

so any code will be helpful.

Your question is quite unclear, but it seems you are concerned about data integrity performing multiple queries. What you need is to use transaction to group a set of commands toghether. This way either all commands will succeed or your database will not be affected by any of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM