MySQL Stored Procedure Example - CREATE TABLE SELECT
Open your SQL Query Editor then copy & paste the below code to make a Stored Procedure to create a backup table of IT employees from another MySQL table using CREATE TABLE SELECT MySQL Sub-Query:
delimiter | CREATE PROCEDURE SP_CREATE_TABLE_SELECT( ) BEGIN CREATE TABLE employees_it_20110421 SELECT * FROM employees WHERE DepartmentID =60; END; |
MySQL Stored Procedure Example - CREATE TABLE SELECT - SQL Query Editor Output
Again open your SQL Query Editor then copy & paste the below code to execute the Stored Procedure to make the backup table:
call SP_CREATE_TABLE_SELECT;
MySQL Stored Procedure Example - Executing Stored Procedure - SQL Query Editor Output
Related Tutorial Examples
- MySQL Stored Procedure: Variable Example
- MySQL Stored Procedure: Batch Salary Increment Example
- MySQL TRUNCATE TABLE Example
- MySQL coalesce() Function Example
- MySQL ISNULL() Function Example
- MySQL NULL to zero value Example
- How To Find MySQL SERVER VERSION Information
- 20 steps to make CakePHP Blog Project
- step 2: download cakephp and setup cakeblog
- PERL Example: Use of Hash Arrays in PERL


No comments:
Post a Comment
leave your comments here..