我有一些程序,我希望在评估条件后得到某种确认.
例如,pusedocode就像,
if ( select count(*) from assgn to where eid = 1 ) > 5
print " the total number of projects employee working is more than 5 "
else
insert the value into the assgnto table
Run Code Online (Sandbox Code Playgroud)
我该如何在MySQL中这样做呢?
Dev*_*oot 23
您可以使用以下SELECT
命令打印一些文本:
SELECT 'some text'
Run Code Online (Sandbox Code Playgroud)
结果:
+-----------+
| some text |
+-----------+
| some text |
+-----------+
1 row in set (0.02 sec)
Run Code Online (Sandbox Code Playgroud)
这是一篇旧文章,但多亏了这篇文章,我发现了这一点:
\! echo 'some text';
Run Code Online (Sandbox Code Playgroud)
使用 MySQL 8 进行测试并正常工作。很酷吧?:)