最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
mysql CONCAT() 连接字符串详细说明
时间:2010-11-16 编辑:简简单单 来源:一聚教程网
mysql教程 concat() 连接字符串详细说明
在有些情况下你想两个或多个字符串,在mysql中有个字符串连接函数concat(),下面我们就讲讲它的使用方法吧。
concat语法
concat(str1,str2,...)
简单实例两个字符串连接
select concat('hello ','world!');
当然你也可以使用表中的字段而不是字符串常量,你可以混合使用它们。让我们看看稍微复杂的例子。假设我们有一个用户表中的姓名和年龄,现在要连接在一起,我们就可以使用select statement uses the concat
select concat(name, ' is ', age,' years old.') from user;
bill is 28 years old.
mark is 32 years old.
julia is 44 years old.
alex is 52 years old.
-
下一个: 如何添加新用户到你的MySQL数据库
相关文章
- mysql sql CONCAT 字符串连接 01-19
- MySQL登录、访问及退出操作解析 10-18
- sql语句 update字段null不能用is null问题解析 09-28
- SQL Server ISNULL 不生效原因及解决分析 09-28
- 关于if exists的用法及说明分析 09-28
- Access数据库日常维护方法 09-28