当前位置 : 主页 > 编程语言 > java >

Mysql如何使用帮助

来源:互联网 收集:自由互联 发布时间:2022-07-07
mysql控制台使用命令: mysql ? if; //帮助格式? 想要知道的问题; Many help items for your request exist. To make a more specific request, please type 'help item', where item is one of the following topics: ALTER USER CRE

mysql控制台使用命令:

mysql> ? if; //帮助格式? 想要知道的问题;
Many help items for your request exist.
To make a more specific request, please type 'help <item>',
where <item> is one of the following
topics:
ALTER USER
CREATE DATABASE
CREATE EVENT
CREATE USER
DROP DATABASE
DROP EVENT
DROP SERVER
DROP TABLE
DROP USER
DROP VIEW
IF FUNCTION
IF STATEMENT

继续:

mysql> ? if function;
Name: 'IF FUNCTION'
Description:
Syntax:
IF(expr1,expr2,expr3)

If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns
expr2; otherwise it returns expr3. IF() returns a numeric or string
value, depending on the context in which it is used.

URL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html

Examples:
mysql> SELECT IF(1>2,2,3);
-> 3
mysql> SELECT IF(1<2,'yes','no');
-> 'yes'
mysql> SELECT IF(STRCMP('test','test1'),'no','yes');
-> 'no'

mysql>

看清楚了吧,就是这么简单。


上一篇:php中heredoc和nowdoc的用法,少写echo
下一篇:没有了
网友评论