sql - How to save records from one table to another table using stored procedure in mysql? -
I have tried, but I do not know how to do it. I want to move from one table to another using a stored procedure in a table. I started with a simple procedure to print the record based on certain conditions (it is not sure whether it is right or wrong). Here is the code by which I have tried:
start the purchase process () DECLARE INT DEFAULT FALSE; A VARCHARCHAR (16); Discovery / Cursor cursor1 for selection from user_name. Open Cure 1; Repeat one again; if one! = '' Then select one; end if; Repeat the end; Stop 1; End; If the user_name column is blank, then I need a stored procedure to transfer those records to another table. Can anyone guide me?
Why should this be a stored procedure?
You can make a copy of records in a query, then delete them with the other.
Copy to another table where the user_name is empty:
other_table (id, user_name, other) SELECT (id, user_name, other) Discovery_configure from WHERE user_name faucet or Trium (User_name) = ''; Then, after copying these records, remove from the original table:
Delete with Discovery_conform WHERE id (SELECT id other_table);
Comments
Post a Comment