我尝试了以下 -
我在命令提示符下创建了一个变量,如下所示 -
mysql> set @myId = 1;
Query OK, 0 rows affected (0.00 sec)
然后,为了显示它,我尝试了以下但没有成功 -
mysql> show myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'myId' at line 1
mysql> show @myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '@myId' at line 1
mysql> PRINT @myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'PRINT @myId' at line 1
mysql> PRINT myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'PRINT myId' at line 1
那么如何显示 的值@myId
?