Today we're going to talk about mysql tutorial SQL stored procedure Process Control if statement usage and instance tutorial
If statement
If the implementation of conditions to determine , to meet different conditions to perform different operations, which we learn to program all know if the role of the following, we look at the MySQL stored procedures in how to use the.
If Contion then list
[ElseIf condition then list] ...
[Else list]
End If
This looks like the conditions in the ASP tutorial, but in ElseIf there are some like the IF in the PHP tutorial, but whatever it is like we know how to use it, let's look at an example of an if statement.
Mysql>create Procedure Ifprod ()
->begin
->set @x=0;
->ins:loop;
->set @x=@x+1;
If @x=100 Then
Leave ins;
End If
Insert into actor (firestname) VALUES (' www.111cn.net ');
End Loop ins;
End
->$$
Query Ok, 0 rows Affected (0.00 sec);
All right, let's use a simple example to illustrate the specific usage of the MySQL SQL stored procedure Process Control if statement
The original site of this website is reproduced annotated from www.111cn.net/database/database.html