连接运算符是双竖线“||” 通过连接运算将两个字段的字符串连接在一起。比如名字和年龄
- SELECT uname||age AS "名字和年龄" FROM uinfo;
SELECT uname||age AS "名字和年龄" FROM uinfo;
结果为:
名字和年龄
黑色头发25
紫色头发19
还可以在结果集中加入字符串
- SELECT uname|| '的年龄为:' ||age AS "名字和年龄" FROM uinfo;
SELECT uname|| '的年龄为:' ||age AS "名字和年龄" FROM uinfo;
黑色头发的年龄为:25
紫色头发的年龄为:19
转自:黑色头发:http://heisetoufa.javaeye.com/