SQL 如何在SQL中检查表的创建日期?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15423889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to check the creation date of tables in SQL?
提问by user2169562
The question is:
问题是:
List of the DW1_ tables
from the USER_OBJECTS
with table names, creation date and time in ISO standard.
名单DW1_ tables
从USER_OBJECTS
与表名,创建日期和时间,采用ISO标准。
that's what I have so far, but it does not work.
这就是我到目前为止所拥有的,但它不起作用。
select table_name, to_char(create_date, 'yyyy-mm-dd') from all_tables
where table_name like 'DW1%'
group by table_name;
It said create_date is invalid identifier.
它说 create_date 是无效标识符。
Can anyone help me with this question?
任何人都可以帮我解决这个问题吗?
回答by sgeddes
Is this what you're looking for?
这是你要找的吗?
select object_name, created
from user_objects
where object_name LIKE 'DW1%'
and object_type = 'TABLE';
回答by Art
select object_name, to_char(created, 'yyyy-mm-dd') AS created -- 'AS' is optional
from user_objects
where object_name like 'EMP%' -- replace with your table
/
回答by rs.
try this
尝试这个
SELECT object_name tablename, created FROM dba_objects
WHERE object_name like 'DW1%'
and object_type = 'TABLE'