当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')
相关文档:
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 ......
SQLServer和Oracle的常用函数对比
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual ......
Oracle数据类型简介
一、概述
在ORACLE8中定义了:标量(SCALAR)、复合(COMPOSITE)、引用(REFERENCE)和LOB四种数据类型,下面详细介绍它们的特性。
二、标量(SCALAR)
合法的标量类型与数据库的列所使用的类型相同,此外它还有一些扩展。它又分为七个组:数字、字符、行、日期、行标识、布尔和可 ......
update customers a
set city_name=(select b.city_name from tmp_cust_city b where b.customer_id=a.customer_id)
where exists (select 1
from tmp_cust_city b
where b.customer_id=a.customer_id
)
-- update 超过2个值
update customers a
set (city_name,customer_type)=(select b.city_name,b.customer_ ......
总结了一下删除重复记录的方法,以及每种方法的优缺点。
假设表名为Tbl,表中有三列col1,col2,col3,其中col1,col2是主键,并且,col1,col2上加了索引。
1、通过创建临时表
可以把数据先导入到一个临时表中,然后删除原表的数据,再把数据导回原表,SQL语句如下:
creat table tbl_tmp (select distinct* from tbl) ......