随笔分类 -  MySQL

摘要:1,函数类 时间函数 #获取当前时间 select now(); #将时间类型转换为字符串类型 timestamp/date可选 SELECT to_char(now()::timestamp , 'YYYY-MM-DD HH24:MI:ss')::text 阅读全文
posted @ 2022-02-14 16:31 iullor 阅读(172) 评论(0) 推荐(0) 编辑
摘要:转载:https://blog.csdn.net/u010429286/article/details/79022484 自理解: 1,MySQL 其 schema 基本上和 database 等同 表所属在具体的schema下; 在程序中 jdbc:mysql://xxx:3306/数据库名称(s 阅读全文
posted @ 2022-01-05 13:35 iullor 阅读(312) 评论(0) 推荐(0) 编辑
摘要:1,获取表 信息 select * from information_schema."tables" t ; 2,获取字段详情 select * from information_schema.columns c where c.table_name ='表名'; 3,获取表具体字段备注信息 SEL 阅读全文
posted @ 2021-12-28 14:19 iullor 阅读(274) 评论(0) 推荐(0) 编辑
摘要:1,批量插入 2,批量更新 3,多参数传值问题 4,插入(更新)后获取主键 6,若数据不存在插入(更新) 7,多列条件in查询 8,参数List、Map 循环问题 Map : https://www.cnblogs.com/xr210/p/13224552.html 阅读全文
posted @ 2021-12-22 10:54 iullor 阅读(102) 评论(0) 推荐(0) 编辑
摘要:mysql 获取数据库的信息步骤 1,可以执行下面SQL 获取 数据库相关的信息 获取到的是数据库中表的名称以及备注 select table_name,table_comment from information_schema.tables where table_schema = databas 阅读全文
posted @ 2021-09-22 14:00 iullor 阅读(532) 评论(0) 推荐(0) 编辑
摘要:###linux服务器上登录用户 mysql /usr/local/mysql/bin/mysql -u root -p 密码 1,数据库新建及为新用户赋权 1,创建数据库 create databases test charset utf8; 2,创建数据库用户 其中 Host:localhost 阅读全文
posted @ 2020-04-24 19:58 iullor 阅读(95) 评论(0) 推荐(0) 编辑
摘要:汉字提取首字母 转自 https://blog.csdn.net/u012998306/article/details/98867025 多谢老哥 fristPinyin : 此函数是将一个中文字符串的第一个汉字转成拼音字母 (例如:"李" l),包括特殊字符处理,可以进行动态添加 sql CREA 阅读全文
posted @ 2019-12-28 18:06 iullor 阅读(1990) 评论(0) 推荐(0) 编辑