
数据库
lxxy623
菜鸟一枚
展开
-
Mysql 更新时间(加上或者减去一段时间)
Mysql时间加减函数为date_add()、date_sub()定义和用法DATE_ADD() 函数向日期添加指定的时间间隔。DATE_SUB() 函数向日期减少指定的时间间隔。语法DATE_ADD(date,INTERVAL expr type)DATE_SUB(date,INTERVAL expr type)date 参数是合法的日期表达式。expr参数是您希望添加的时间间隔。type 参数可以是下列值:MICROSECONDSECONDMINUTEHOURDAYWEEK原创 2021-04-20 09:43:01 · 274 阅读 · 0 评论 -
重置密码遇到ERROR 1064 (42000): Access denied for user ‘root‘@‘localhost‘ (using passwor:yes)问题
问题截图:忘记登入密码,直接进入mysql中使用update修改用户密码出现问题修改mysql中的root账户密码出现ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(“root”) where user=“root”’ at line 1原创 2020-12-27 20:23:36 · 451 阅读 · 0 评论 -
Oracle SQL 获取本月内的所有周一
select * from (--转化成周一去重select distinct trunc(t.day,'iw') as mon from (--获取本月所有日期集合SELECT trunc(sysdate, 'mm') + LEVEL - 1 DAYFROM DUALCONNECT BY trunc(sysdate, 'mm') + LEVEL - 1 <=la...转载 2020-04-10 14:20:29 · 872 阅读 · 0 评论 -
oracle SQL 语句取周一到当前、本周、本月、本年的数据
--取本周时间内的数据select * from table where DTIME >=trunc(next_day(sysdate-8,1)+1) and DTIME<=trunc(next_day(sysdate-8,1)+7)+1 ; --国外的select * from table where DTIME >=trunc(next_day(sysdate-8...原创 2020-04-08 16:26:04 · 1285 阅读 · 1 评论 -
Oracle使用group by进行分组,然后进行分页
其代码:select * from(SELECT rownum as rn, a.* FROM (select count(rdr_Id),rdr_id from RDRPARTACTIV_LOG p group by rdr_Id ORDER BY count(rdr_Id) desc) a where rownum<=20)where rn>0原创 2020-04-07 17:29:40 · 1247 阅读 · 0 评论