数据库
qq_38999509
这个作者很懒,什么都没留下…
展开
-
Mybatis-PageHelper自定义count查询
pom.xml<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.3.0</version> </dependency>a.原创 2021-05-13 14:47:16 · 1062 阅读 · 0 评论 -
同时删除父表和子表的数据
delete 别名a,别名bfrom 表名别名a, 表名别名a where 条件列子delete i,o from ccp_order_item i , ccp_order o where i.order_id=o.order_id原创 2021-03-02 10:08:11 · 1151 阅读 · 0 评论 -
通过函数把城市名称转换成大写的首字母
CREATE FUNCTION `fristPinyin`(P_NAME VARCHAR(255)) RETURNS varchar(255)BEGIN DECLARE V_RETURN VARCHAR(255); SET V_RETURN = ELT(INTERVAL(CONV(HEX(left(CONVERT(P_NAME USING gbk),1)),16,10), 0xB0A1,0xB0C5,0xB2C1,0xB4EE,0xB6EA,0xB7A2,0xB8C1.原创 2021-01-09 10:26:16 · 276 阅读 · 0 评论 -
Mysql8.0创建用户限制指定IP可访问
因为数据库的安全的问题,不建议使用root用户用来连接数据库进行操作,所以需要创建一个新用户,并且需要指定ip,这样就会更安全,因为不是指定的ip,那么就连接不到mysql因为有多个服务器需要连接到mysql, 并且最好是使用一个账号来连接,因为账号太多不易管理,所以就需要创建一个账号,并且指定多个ip限制访问。根据一些教程根本就行不通…,最后根据自己摸索和查询资料,总结一下操作命令行连接mysql本地连接mysql -u用户名 -p密码远程连接mysql -h 远程ip或域名...原创 2020-07-01 15:28:38 · 4017 阅读 · 0 评论 -
MYSQL列中的数据以逗号隔开,如何查询
第一种select ic.* from cose_item_category ic where find_in_set (ic.item_category_id,(select c.item_category_id from cose_coupon_code c where c.coupon_code_id='')) 第二种select ic.* from cose_item_category ic where find_in_set (ic.item_category_id,'13,原创 2020-05-16 09:58:54 · 616 阅读 · 0 评论