Database
__BMGT()
___
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Mysql 取每月的最后时刻
select concat(LAST_DAY("2019-09-01")," 23:59:59") ;取每月最初的时刻 用 interval关键字然后用 日期函数 add 等操作原创 2021-09-23 18:01:51 · 540 阅读 · 0 评论 -
Go 仿SQL解析
仿SQL结构:<begin statement> begin [isolation level (read committed|repeatable read)] begin isolation level read committed<commit statement> commit<abort statement> abort<create statement> create table &转载 2020-10-16 17:01:33 · 408 阅读 · 0 评论 -
MySQL info by shell script
#!/bin/shINTERVAL=5PREFIX=$INTERVAL-sec-statusRUNFILE=/home/benchmarks/running #not exist!!!ACCOUNT='-uroot -p123456'mysql world $ACCOUNT -e 'SHOW GLOBAL VARIABLES' >> mysql-variables# while test -e $RUNFILE;do file=$(date +%F_%I) sle.原创 2020-07-30 15:29:21 · 316 阅读 · 0 评论 -
Mybatis查询 注意 传入参数
Myfault solving:<select id="findUserByNameAndPasswd" resultType="com.xiuye.orm.User" parameterType="string"> select * from user where username = #{0} and password=#{1} <select id="findUserB转载 2016-06-05 15:51:18 · 6511 阅读 · 0 评论 -
定时任务多线程(结合spring测试)
package com.xiuye.bean;public class TestForUpdate { private String uuid; private String content; private int state; public int getState() { return state; } public void setState(int state原创 2016-12-20 09:58:24 · 2380 阅读 · 0 评论 -
数据库空表也能查询到一条数据
select sum(inout) as sum from UserTable;查询空表会有一条数据,只是值为空(不是null)而已原创 2017-07-29 18:36:54 · 2413 阅读 · 0 评论 -
mysql installed big problem: table mysql.host not existence!
solution:cp mysql/scripts/data/mysql mysql/dataservice mysql55 startIf that service doesn't exist,you have to copy mysql/support-files/mysql.server to /etc/init.d/mysql55cp mysql/support原创 2017-12-20 05:43:39 · 274 阅读 · 0 评论 -
mysql 5.6.38 "cmake ," error solution
apt-get install libncurses5-devfind /usr -name libncurses*mysql-5.6.38$ cmake . -DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/libncurses.so -DCURSES_INCLUDE_PATH=/usr/includemake原创 2017-12-19 05:44:48 · 436 阅读 · 0 评论 -
MongoDB创建用户和Java连接MongoDB
> use testswitched to db test> db.createUser({user:"xiuye",pwd:"123456",roles:[]})Successfully added user: { "user" : "xiuye", "roles" : [ ] }> show tables;system.userssystem.version> db.system原创 2018-01-16 23:31:25 · 8156 阅读 · 1 评论 -
查询不满足条件并且平均值最大的那个数据
example : 查询 学生中 某科目 不及格, 平均分数 最大 的学生:create table student(id number primary key,name varchar2(10),subject varchar2(20),score number);select * from user_tables;select abs(mod(dbms_random.rando...原创 2018-03-26 14:37:01 · 382 阅读 · 0 评论 -
MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
select @@sql_mode;set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'set session sql_mode='STRICT_TRANS_TA...原创 2018-07-17 22:59:45 · 941 阅读 · 0 评论 -
Spring Boot 学习 @Transactional注解 事务生效了吗?一种查看方式(打印log)
1.首先,找到spring boot的默认的事务管理器,一般继承至于org.springframework.transaction.PlatformTransactionManager2.设置事务管理器打印log,应该包含开始事务,结束事务的输出日志.eg.我的工程包含JPA,MyBatis,在Service层编写异常,测试事务是否回滚:@Transactional @Override pub...原创 2018-07-15 23:12:22 · 8371 阅读 · 3 评论 -
数据库的char和varchar/varchar2
数据库中的char分配多少位,查询条件就是多少位,写入数据的时候,不足的补空格,而varchar/varchar2则是按需分配,不足位数,不补空格,查询条件不需补足位数。明明查询语句是对的,条件也是对的,为啥查不出结果,是不是因为char补位数“空格”,该死的char类型!原创 2016-10-14 14:04:26 · 612 阅读 · 0 评论 -
mysql windows service config though mysql info for next new OS or new PC
C:\Users\Administrator>sc qc mysql56[SC] QueryServiceConfig 成功SERVICE_NAME: mysql56 TYPE : 10 WIN32_OWN_PROCESS START_TYPE : 3 DEMAND_START ERROR_原创 2016-06-05 09:33:54 · 664 阅读 · 0 评论 -
数据库数据横排显示2
if object_id('#case') is not null drop table #casegocreate table #case( id int identity ,issue_type varchar(20) null,asset_id int null)go insert into #case select 'for issue',1701335119转载 2015-12-31 09:37:59 · 561 阅读 · 0 评论 -
提取表的sql原句
select a.name+' ' +case a.usertype when 7 then 'int' when 6 then 'smallint' when 2 then 'varchar' when 11 then 'money' when 1 then 'char' when 8 then 'float' when 12 then 'datetime' wh原创 2015-12-31 09:50:25 · 514 阅读 · 0 评论 -
oracle services
OracleVssWriterORCLf:\app\xiuye\product\11.2.0\dbhome_1\bin\OraVSSW.exe ORCLOracleDBConsoleorclF:\app\xiuye\product\11.2.0\dbhome_1\bin\nmesrvc.exeOracleJobSchedulerORCLf:\app\xiuye\product\11.转载 2016-02-07 15:10:55 · 1063 阅读 · 0 评论 -
hibernate.cfg.xml(2)
<!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><property name="connection.driver_class"转载 2016-03-07 15:51:15 · 549 阅读 · 0 评论 -
sybase 修改密码
sp_password 'old pass','new pass'go原创 2016-03-29 11:29:05 · 2536 阅读 · 0 评论 -
读取oracle sequence 的currval
select serial.currval from dual;//mybe error刚创建的sequence的currval可能还没有值必须:select serial.nextval from dual 后才能有效执行以上语句原创 2016-05-12 12:17:55 · 807 阅读 · 0 评论 -
java mysql connection url
jdbc:mysql://127.0.0.1:3306/tienonweb?useUnicode=true&characterEncoding=utf8注意为utf8转载 2016-04-21 11:08:24 · 1111 阅读 · 0 评论 -
oracle SQL 错误: ORA-02014: 不能从具有 DISTINCT, GROUP BY 等的视图选择 FOR UPDATE
错误的思路sql语句:select rownum,a.id,a.deptno FROM (select emp.* from emp where state=1 order by deptno asc) a where rownum 错误原因:SQL 错误: ORA-02014: 不能从具有 DISTINCT, GROUP BY 等的视图选择 FOR UPDATE02014. 00原创 2016-05-31 14:48:11 · 13908 阅读 · 0 评论 -
mybatis报了一个java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
在xml配置文件中,不要多加分号哈,尤其是在其sql语句后。原创 2016-05-31 15:10:23 · 3685 阅读 · 1 评论 -
oracle dbms_output.put_line 输出
set serveroutput on; declare --类型定义 cursor cc is select empno,ename,job,sal from emp; --定义一个游标变量 ccrec cc%rowtype; begin --for循环 for原创 2016-06-02 13:20:09 · 9132 阅读 · 0 评论 -
oracle 自动增长更新id
create sequence id;update app set id = id.nextvalcommit;原创 2016-06-02 15:35:09 · 1184 阅读 · 0 评论 -
Mybatis直接插入oracle序列号
原创 2016-06-03 14:02:17 · 1076 阅读 · 0 评论 -
数据库数据横排显示
L_ADVANTAGE11.1?if object_id('#case') is not null drop table #casecreate table #case( id int identity ,issue_type varchar(20) null,asset_id int null)go insert into #case select 'for iss原创 2015-12-31 09:35:02 · 812 阅读 · 0 评论
分享