LOCAL, SESSION, AND GLOBAL VARIABLES IN MYSQL : Variable Scope « Procedure Function « SQL / MySQL






LOCAL, SESSION, AND GLOBAL VARIABLES IN MYSQL

 


mysql>
mysql> SET @cost = 5, @cost1 = 8.00;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> select @cost;
+-------+
| @cost |
+-------+
| 5     |
+-------+
1 row in set (0.01 sec)

mysql>
mysql> select @cost1;
+--------+
| @cost1 |
+--------+
| 8.00   |
+--------+
1 row in set (0.00 sec)

mysql>

        








Related examples in the same category

1.Variable scope
2.Inner variable shadows the outter variable
3.Nested blocks
4.Using Declare statement to declare the local variable