随笔分类 -  mysql

摘要:1、常规方法 1 -- 当前时间 2 select now() as 当前时间; 3 -- 当前时间转换为时间戳 4 select unix_timestamp(now()) as 转换为时间戳; 5 -- 时间戳格式化 6 SELECT FROM_UNIXTIME(unix_timestamp(n 阅读全文
posted @ 2021-04-27 18:21 绮楼听风雨 阅读(853) 评论(0) 推荐(0)
摘要:方法1、concat()函数 1 select code, name, 2 case 3 when length(code)=6 then concat(code,'000000') 4 when length(code)=9 then concat(code,'000') 5 else code 阅读全文
posted @ 2021-02-23 23:33 绮楼听风雨 阅读(2710) 评论(0) 推荐(0)