
MySQL
潇兮水寒
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SQL打印日期区间所有日期
select dateStr from ( select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) dateStr from (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union...原创 2022-01-17 13:41:49 · 1066 阅读 · 0 评论 -
浅析MySQL中concat以及group_concat的使用
说明:本文中使用的例子均在下面的数据库表tt2下执行:一、concat()函数1、功能:将多个字符串连接成一个字符串。2、语法:concat(str1, str2,...)返回结果为连接参数产生的字符串,如果有任何一个参数为null,则返回值为null。3、举例:例1:select concat (id, name, score) as info from tt2;中间有一行为null是因为tt2...转载 2018-06-19 19:04:11 · 189 阅读 · 0 评论 -
MySQL多列索引的应用
转自:https://segmentfault.com/a/1190000010443438 多列索引 我们经常听到一些人说"把WHERE条件里的列都加上索引",其实这个建议非常错误。在多个列上建立单独的索引大部分情况下并不能提高MySQL的查询性能。MySQL在5.0之后引入了一种叫“索引合并”(index merge)的策略,一定程度上可以使用表上的多个单列索引来定位指定的行。但是当...转载 2019-07-16 14:28:20 · 248 阅读 · 0 评论