当oracle出现 格式与字符串格式不匹配解决办法
select v.spid spid,v.appid appid,v.version version,v.newversion newversion,v.status status,v.createtime createtime from adc_spversionchangeapply v inner join adc_application a on a.id=v.appid
where a.create_by = 'a' and v.appid = '12000000005' and (v.createtime >= '1987-05-06') and (v.createtime <= '2009-04-29')
加入v.createtime在数据库中试date类型 那么会跑出异常
ORA-01861: 文字与格式字符串不匹配
实际上是因为 '1987-05-06'是字符串类型导致的date类型与字符串类型 件跨类型比较 所以是有问题的
将'1987-05-06' 写成to_date('1987-09-18','yyyy-mm-dd')
就行了
代码如下
select v.spid spid,v.appid appid,v.version version,v.newversion newversion,v.status status,v.createtime createtime from adc_spversionchangeapply v inner join adc_application a on a.id=v.appid
where a.create_by = 'a' and v.appid = '12000000005' and (v.createtime >= to_date('1987-05-12','yyyy-mm-dd')) and (v.createtime <= to_date( '2009-04-29','yyyy-mm-dd')
相关文档:
import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
} ......
public ActionForward backUpAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
&n ......
http://inthirties.com:90/thread-918-3-1.html
This article describes the installation of
Oracle 10g release 2 (10.2.0.1) RAC on Linux (Oracle Enterprise Linux
4.5) using NFS to provide the shared storage.
Introduction
Download Software
Operating System Installation
Oracle Installation Prereq ......
今天从数据库中导出几张表,但发现需要的序列都没导出来,于是网上找找方法,发现了如下语句
select
'create sequence USERNAME.'|| t.sequence_name || ' minvalue '||MIN_VALUE||' maxvalue '||MAX_VALUE||' start with '||LAST_NUMBER||' increment by '||INCREMENT_BY||' cache '||CACHE_SIZE||' ;'
from dba_sequen ......
总结了一下删除重复记录的方法,以及每种方法的优缺点。
假设表名为Tbl,表中有三列col1,col2,col3,其中col1,col2是主键,并且,col1,col2上加了索引。
1、通过创建临时表
可以把数据先导入到一个临时表中,然后删除原表的数据,再把数据导回原表,SQL语句如下:
creat table tbl_tmp (select distinct* from tbl) ......