随笔分类 -  数据库

摘要:两个函数都是用于拼接字符串 测试数据表如下: concat 返回多少行显示多少行 concat(str,str,……) str可以替换成字段名 group_concat 返回结果合成一行 group_concat(str,str,……) str可以替换成字段名 阅读全文
posted @ 2020-03-27 10:44 she11s 阅读(165) 评论(0) 推荐(0)
摘要:这两个函数的主要作用是合并字段为字符串 数据表如下: concat 用法: concat(column1,column2,columnn) concat_ws 用法: concat_ws('填分隔符',column1,column2,columnn) 阅读全文
posted @ 2020-03-24 21:25 she11s 阅读(2489) 评论(0) 推荐(0)
摘要:数据表a数据如下: 列坐标从0开始 查询多少列(包括当前列)从1开始 limit limit offset 阅读全文
posted @ 2020-03-23 10:58 she11s 阅读(159) 评论(0) 推荐(0)
摘要:substr() substr中的pos从1开始计数 substr中的len把当前位置当作第一个 substr(str,pos) substr(str from pos) substr(str,pos,len) substr(str from pos for len) mid() mid和subst 阅读全文
posted @ 2020-03-23 09:44 she11s 阅读(884) 评论(0) 推荐(0)