摘要: 使用注解的时候再service层的两个方法中分贝添加了@Scheduled注解和@Transactional注解,启动项目时报错,报错信息为: log4j:WARN Please initialize the log4j system properly.log4j:WARN See http://l 阅读全文
posted @ 2020-05-25 16:58 正月雨 阅读(976) 评论(0) 推荐(0) 编辑
摘要: 内连接 现在有两张表,学生表student1,成绩表SC1,两张表的数据如下 现在要对两张表做连接查询,连接一般需要写条件,where 或者 on 后面 , select * from student,SC where student.sid=SC.sid from 后面直接写两个表名,这样写等价于 阅读全文
posted @ 2019-04-28 15:36 正月雨 阅读(35548) 评论(1) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2019-04-26 17:08 正月雨 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 要写一个存储过程,如果临时表 test 不存在 ,新建临时表,如果存在不新建 alter procedure testas if object_id('tempdb..#test') is null begin print '不存在' create table #test ( number int 阅读全文
posted @ 2019-04-26 10:45 正月雨 阅读(4606) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-04-25 10:32 正月雨 阅读(1) 评论(0) 推荐(0) 编辑
摘要: --随机数保留两位小数 --视图创建 as go 和存储过程不一样,sql语句需要别名 --因为函数中不能使用 rand() ,所以先创建一个视图,函数调用视图create view v_randomas select round((RAND()*1000),2) as random1go --调用 阅读全文
posted @ 2019-04-25 09:57 正月雨 阅读(2579) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-04-24 17:20 正月雨 阅读(1) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-04-24 17:19 正月雨 阅读(1) 评论(0) 推荐(0) 编辑
摘要: --复制另一个数据库中的某张表的结构及数据--select * from Test.dbo.TestTable(查询表中所有数据) --into [表名] 插入当前数据库新表,如果没有该表就创建 select * into TestCopy from Test.dbo.TestTable --只复制 阅读全文
posted @ 2019-04-24 10:41 正月雨 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: MySQL子查询里不能使用 limit 但是可以在子查询里的子查询里使用limit SELECT id from (SELECT id from book ORDER BY RAND(50) LIMIT 40) t 不可以 UPDATE book set free=0 where id in(SEL 阅读全文
posted @ 2019-04-01 13:31 正月雨 阅读(98) 评论(0) 推荐(0) 编辑