### Cause: java.sql.SQLException: ORA-00918: 未明确定义列

Oracle在mybatis中查询出错,加了分页嵌套语句,单查里面的SQL没问题,于是我将SQL复制到Navicat上执行,报错:[Err] ORA-00918: column ambiguously defined百度得知是在嵌套语句时候有字段重复,也就是一样的,它无法分辨是子表里的还是哪张表中的字段,这种情况给表字段都起个别名即可

ORA-01658: 无法为表空间XXX段创建 INITIAL 区

ORA-01658: unable to create INITIAL extent for segment in tablespace string用Navicat操作oracle建表时候发生如上错误,百度搜了下也有类似解决方法,例如:https://blog.csdn.net/j080624/article/details/78731412但是我操作的oracle有自己的表空间,应该不能给现有表空间扩容,于是,我了解到数据表应该存在其中某个表空间。立马操作:Navicat打开刚刚建好的表,右键点“设计”,然后在tab上点“选项”,然后切换到自己需要的表空间即可,实体属性如果不知道切勿修改,乱改的话可能会保存不了。如何避免这种错误?在建表时就对表空间进行指定,其中NAMES指代指定的表空间,按实际情况修改,以下参数也是根据实际情况改:tablespace NAMES  pctfree 10  initrans 1  maxtrans 255  storage  (    initial 64K    next 8K    minextents 1    maxextents unlimited  )

MYSQL数据库删除重复数据行

下列Sql可用in,建议用existsSELECT *FROM coldknow aWHERE EXISTS ( SELECT title, img FROM coldknow GROUP BY title, img HAVING (COUNT(1) > 1 AND a.title = title AND a.img = img) ) AND NOT EXISTS ( SELECT MIN(id) FROM coldknow GROUP BY title, img HAVING COUNT(1) > 1 AND MIN(id) = id )a作为父表与虚拟子表进行关联,前exists存在父表字段与虚拟表相同的特征,后exists排除最小id的行,即保留重复记录中最小id的行

cassandra cql中like模糊查询可能性

参考:http://www.tsoft.se/wp/2016/08/12/sql-like-operation-in-cassandra-is-possible-in-v3-4/

mongodb studio 3t 破解无限试用脚本

编写一个bat或cmd文件,内容如下:@echo offECHO 重置Studio 3T的使用日期......FOR /f "tokens=1,2,* " %%i IN ('reg query "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\3t\mongochef\enterprise" ^| find /V "installation" ^| find /V "HKEY"') DO ECHO yes | reg add "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\3t\mongochef\enterprise" /v %%i /t REG_SZ /d ""ECHO 重置完成, 按任意键退出......pause>nulexit运行即可破解试用,另外可以加到开机启动运行

sqlite转换成MySQL迁移及一键sqlite转MySQL软件

下列是我从网上搜集并做的一个整理,若有未提及地方请指出:从sqlite数据库导入到mysql数据库实例从sqllite中导出数据文件库XX.sql的文件。导入到mysql数据库中。键入命令: source /smb/works/mysql.sql出现很多如下的错误:You have an error in your SQL syntax; check the manual thatcorresponds to your MariaDB server version for the right syntax to use near XXXXXXXXX原因是sqllite与mysql语句有很大的区别:左边为MYSQL、右边为SQLite1、启动事务Mysql 为start transactionSqlite 为 begin transaction2、提交事务Mysql 为commitSqlite 为commit transaction因此需要移除所有的 [BEGIN TRANSACTION] [COMMIT] 以及 任何包含 [sqlite_sequence] 的(整)行3 创建表Mysql的库名、表名、列明等都不需要使用[ ]sqlite 所有的名称都需要增加[ ]4、数据类型sqlite的数据类型mysql都支持。但是sqlite中定义了范围在mysql中导入会报错。只有varchar需要定义范围。5、冲突解决SQLite 的 ONCONFLICT子句不是独立的SQL命令。这是一条可以出现在许多其他SQL命令中的非标准的子句。在Mysql中不支持。6、引号将 ["] 改为 [`]也可以移除全部的 ["] ,但是如果有一些函数名作为字段名(e.g. regexp)时将会遇到错误需要注意一些默认为 ["] ,其作用不在字段上的,不应被替换而应当被保留7、将所有 [autoincrement] 改为 [auto_increment]8、将所有 ['f'] 改为 ['0'] 并将所有 ['t'] 改为 ['1']或者['False']改为['0']及['True']改为['1']9、text字段不能设置unipue,需改为varchar(255)10、注意sqlite是不区分类型的,所以有些整形字段和text字段要修改配合mysql。11、默认设为CURRENT_TIMESTAMP的字段类型一定为TIMESTAMP。另外还有其他可能不同的字段类型在导入sql报错时候可以百度解决将修改完的sql文件保存,然后通过工具导入到mysql中即可。参考原文:https://www.2cto.com/database/201604/501991.html          https://blog.csdn.net/duomoke/article/details/48246229当然最后来个最简单sqlite转MySQL方法,可以使用sqliteToMysql软件一键转换,只需要选择原db地址及目标MySQL地址即可,下载链接如下(有内购 不过可以免费试用):链接:https://pan.baidu.com/s/18mEN4JfHffseYf9N3GCeyA 提取码:9vv9

pgsql中能用to_date表示详细时间么?怎么表示具体时间段

    在Oracle中选择具体时间区间只需将字符用to_date进行转换成时间即可。但是在postgresql中是不是发现没效果咯?!    测试发现pgsql中的to_date真的是将时间转换成日期,而非精确到分秒,如下sql:select * from LOG a  where  a.CREATE_TIME >= to_date('2019-01-08 00:00:00','yyyy-MM-dd HH24:mi:ss') and a.CREATE_TIME <= to_date('2019-01-08 16:30:43','yyyy-MM-dd HH24:mi:ss')这样写虽然具体时间不一样,但是由于转换的是日期因此两实际时间在pgsql中是一样的,这种情况只需要将to_date改成to_timestamp即可,以后注意pgsql中to_date返回的是日期,非具体时间。

解决centos安装mysql依赖出错问题提示保护多库版本

当执行以下命令安装依赖时候:yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6时候出现了如下错误:Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: mirrors.cn99.comSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package libaio.i686 0:0.3.107-10.el6 will be installed---> Package libgcc.i686 0:4.4.7-23.el6 will be installed---> Package libstdc++.i686 0:4.4.7-23.el6 will be installed--> Finished Dependency ResolutionError:  Multilib version problems found. This often means that the root       cause is something else and multilib version checking is just       pointing out that there is a problem. Eg.:                1. You have an upgrade for libgcc which is missing some            dependency that another package requires. Yum is trying to            solve this by installing an older version of libgcc of the            different architecture. If you exclude the bad architecture            yum will tell you what the root cause is (which package            requires what). You can try redoing the upgrade with            --exclude libgcc.otherarch ... this should give you an error            message showing the root cause of the problem.                2. You have multiple architectures of libgcc installed, but            yum can only see an upgrade for one of those arcitectures.            If you don't want/need both architectures anymore then you            can remove the one with the missing update and everything            will work.                3. You have duplicate versions of libgcc installed already.            You can use "yum check" to get yum show these errors.              ...you can also use --setopt=protected_multilib=false to remove       this checking, however this is almost never the correct thing to       do as something else is very likely to go wrong (often causing       much more problems).              Protected multilib versions: libgcc-4.4.7-23.el6.i686 != libgcc-4.4.7-4.el6.x86_64 You could try using --skip-broken to work around the problem** Found 6 pre-existing rpmdb problem(s), 'yum check' output follows:1:libreoffice-core-4.0.4.2-9.el6.x86_64 has missing requires of libjawt.so()(64bit)1:libreoffice-core-4.0.4.2-9.el6.x86_64 has missing requires of libjawt.so(SUNWprivate_1.1)(64bit)1:libreoffice-ure-4.0.4.2-9.el6.x86_64 has missing requires of jre >= ('0', '1.5.0', None)2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16()(64bit)2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of mysql-libs解决方法也很简单,用下列代码执行安装即可:yum install --setopt=protected_multilib=false libaio.so.1 libgcc_s.so.1 libstdc++.so.6

MySQL创建表时,设置自动插入当前时间字段的两种格式

1.timestamp类型create table manager(id int not null primary key,mdate timestamp not null default current_timestamp);2.datetime类型create table manager(id int not null primary key,mdate datetime);