
Sql
文章平均质量分 67
宇1990
这个作者很懒,什么都没留下…
展开
-
SQL问题
注解方式的IOC流程AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanConfig.class); UserEntity userEntity = (UserEntity)applicationContext.getBean("userEntity");原创 2021-10-28 10:18:05 · 140 阅读 · 0 评论 -
linux下安装mysql-5.7.25详细步骤
第一步:下载进入到mysql官网下载自己对应版本的mysql,下载地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads我这里下载mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz版本也可以进入linux后用命令下载wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz转载 2021-05-25 15:03:24 · 197 阅读 · 0 评论 -
springboot连接oracle集群oracle导致出错
当不为oracle集群的时候使用直接连语句是没有问题的spring.datasource.url=jdbc:oracle:thin:@ip:prot:sid但是当使用oracle语句或者遇到oracle版本问题是会出现连接问题使用ora连接就不会有这个问题spring.datasource.url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.30.65.54)(PORT=11521))(CONNECT_D原创 2020-07-03 19:21:49 · 620 阅读 · 0 评论 -
mysql总结
1、主从复制,2、sql优化(不用in,count(*),where不用函数,用between and exists等)https://blog.youkuaiyun.com/wenzhenyu1990/article/details/873636373、常见sql的书写(not exists所有都用(双重not exists)) , group by having ,max(ca...原创 2019-12-11 17:26:54 · 136 阅读 · 0 评论 -
Mysql比较
sql优化:https://www.cnblogs.com/lonnie/p/8320095.html1、当数据库统计一天的数据但是数据库字段存的是datatime类型的时候(当然最好是直接使用data日期类型)where语句当中使用data_format和like的时间区别(原则最好在where语句的右边最好不要有函数计算同时也不要使用like这样会造成遍历全表 )确实要使用的时候 ...原创 2019-12-02 11:29:58 · 130 阅读 · 0 评论 -
切换数据库服务导致springboot启动问题
记录一下昨天遇到的问题:切换成阿里云的mysql服务以后,springboot服务启动报错;提示数据库表不存在;com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jeewms.T_S_student' doesn't exist主要是因为linux下mysql表名大小写灵敏而windows下my...原创 2019-08-10 18:36:31 · 343 阅读 · 0 评论 -
几条面试的sql 和mysql
CREATE TABLE `course` ( `cid` int(11) NOT NULL, `cname` varchar(255) COLLATE utf8_bin DEFAULT NULL, `teacher` varchar(255) COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`cid`)) ENGINE=InnoDB D...原创 2019-02-26 18:57:38 · 154 阅读 · 0 评论 -
mysql主从复制搭建
参考这篇实现https://blog.youkuaiyun.com/wenzhenyu1990/article/details/87921637遇到的问题:1、不能切换到mysql (重装)2、-u root -p ‘密码’ 不能登录 use mysql 切换到mysql授权GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED ...转载 2019-02-27 17:46:08 · 86 阅读 · 0 评论 -
mysql中的sql语句
#全选课的学生select snamefrom student swhere not exists (select * from course cwhere not exists (select * from scwhere sid =s.sidand sc.cid=c.cid) )原创 2018-11-21 10:55:29 · 146 阅读 · 0 评论 -
Mysql 海量数据时候sql语句优化
1、在where或者order by上建立索引,避免权标查询2、减少where语句的null判断以及!= <> 这样会放弃索引操作而进行全表查询null最好改成=03、or改成union 或者union all4、in改成between 或者exists如select num from a where a.num in (select num from b )改...转载 2018-10-22 09:49:48 · 210 阅读 · 0 评论