易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle日期类型问题

oracle日期类型字段是不是不能存储2009-01 这样类型的字段啊?也就是说只到月份,谢了啊
好像不能。只能存储为varchar类型 to_char(sysdate,'yyyy-mm')

引用
好像不能。只能存储为varchar类型 to_char(sysdate,'yyyy-mm')

正解

引用 1 楼 vber1010 的回复:
好像不能。只能存储为varchar类型 to_char(sysdate,'yyyy-mm')

可以啊,你日期的日随便填写啊,反正你取出来的时候又不用

SQL code:

drop table test_date;
create table test_date(
test_date date
);
insert into test_date
select to_date('2010-1','yyyy-mm') from dual union all
select to_date('2010-1','yyyy-mm') from dual union all
select to_date('2010-1','yyyy-mm') from dual;

select * from test_date;

--结果
/*
2010-1-1
2010-1-1
2010-1-1
*/




相关问答:

Windows 7 怎样安装Oracle - Oracle / 基础和管理

各位大哥,帮个忙。

下个Oracle for vista 版本的安装试试
10G和11G的 
http://www.oracle.com/technology/software/products/database/index.html 
------------------------------------------- ......

Oracle的blob字段问题 - Oracle / 开发

查了一天的blob,还是没理解到,我想在VC下存取二进制的文件,使用的是oo4o,照着帮助文档上面的写了写入数据库的代码,还是没写对,错误提示是this operation is not permitted on a empty LOB,这是什么意思啊?照 ......

求一sql语句 - Oracle / 开发

两个表
请看 "Persons" 表:
name banji shunxu
yiyang 01 1
yiyang 02 1
lili 01 2
  
接下来请看 "xueke" 表:
name kemu shunxu
yiy ......

oracle知识 - Oracle / 基础和管理

在Oracle 数据库中怎么查前三条记录降序;
select * from
  (select * from table order by col_name desc)
where rownum<=3;

select * from
(
select s.*,rownum rn 
from t3 s
)
where ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号