avatar
A wield thing in Oracle DB# Database - 数据库
g*l
1
I tried to do such a query against USER_OBJECTS :
SELECT * FROM USER_OBJECTS WHERE CREATED='10/15/2002';
It shows no row selected, but I know there is an object in the view.
If I change the query to :
SELECT * FROM USER_OBJECTS WHERE OBJECT_NAME='thename';
It will show:
OBJECT_NAME: thename
CREATED: 10/15/2002
And if I retrieve data from a user-defined table also based on the date, it is
fine. For example:
SELECT * FROM my_table WHERE enroll_date='10/15/2002';
the type of ENROLL_DATE is DATE too
avatar
s*d
2
when i do date related staff, i prefer
where to_char(enroll_date,'mm-dd-yyyy')='10-15-2002'
so u dont need to consider the format difference.

is

【在 g*******l 的大作中提到】
: I tried to do such a query against USER_OBJECTS :
: SELECT * FROM USER_OBJECTS WHERE CREATED='10/15/2002';
: It shows no row selected, but I know there is an object in the view.
: If I change the query to :
: SELECT * FROM USER_OBJECTS WHERE OBJECT_NAME='thename';
: It will show:
: OBJECT_NAME: thename
: CREATED: 10/15/2002
: And if I retrieve data from a user-defined table also based on the date, it is
: fine. For example:

avatar
a*c
3
Actually the default date format in Oracle is 'DD-MON-YY', such as
'17-OCT-02'. You can use it without any format strings. I guess the CREATED
field in USER_OBJECTS is something like 'DD-MON-YYYY HH24:MI:SS' , so you
wound get any hit by simply providing the date for your query. You might try
WHERE created > '15-OCT-2002'. See what would happen then. :)

it

【在 s****d 的大作中提到】
: when i do date related staff, i prefer
: where to_char(enroll_date,'mm-dd-yyyy')='10-15-2002'
: so u dont need to consider the format difference.
:
: is

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。