MySQL 如何在执行SQL脚本时输出打印语句
若要在执行SQL脚本时输出打印语句,请使用以下语法。
语法如下-
SELECT ‘anyStringValue as’ ‘;
查询如下-
mysql> select 'This is a SQL Script' AS' ';
输出如下-
+----------------------+
| |
+----------------------+
| This is a SQL Script |
+----------------------+
1 row in set, 1 warning (0.00 sec)
你可以使用concat()函数添加动态数据到你的状态中,如insert,update和delete。查询如下-
mysql> select concat ("Inserted ", row_count(), " rows successfully") AS '';
输出如下-
+-------------------------------+
| |
+-------------------------------+
| Inserted -1 rows successfully |
+-------------------------------+
1 row in set (0.00 sec)
阅读更多:MySQL 教程
极客教程