如何在MySQL中模拟打印语句? [英] How can I simulate a print statement in MySQL?

查看:288
本文介绍了如何在MySQL中模拟打印语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些程序可以在病情评估后得到某种确认.

I have some procedures where I would like to get some kind of acknowledgement after a condition has been assessed.

例如,pusedocode就像

For example, the pusedocode would be like,

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  

我应该如何在MySQL中做到这一点?

How should I go about doing that in MySQL?

推荐答案

如果您不想两次将文本用作列标题和值,请使用以下stmt!

If you do not want to the text twice as column heading as well as value, use the following stmt!

选择一些文字"作为; 

SELECT 'some text' as '';

示例:

mysql>选择'some text'作为''; + ----------- + | | + ----------- + |一些文字| + ----------- + 设置1行(0.00秒)

mysql>SELECT 'some text' as ''; +-----------+ | | +-----------+ | some text | +-----------+ 1 row in set (0.00 sec)

这篇关于如何在MySQL中模拟打印语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆