0

The question is:

List of the DW1_ tables from the USER_OBJECTS with table names, creation date and time in ISO standard.

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.

Can anyone help me with this question?

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164
user2169562
  • 1
  • 1
  • 1
  • 1

3 Answers3

6

Is this what you're looking for?

select object_name, created 
from user_objects 
where object_name LIKE 'DW1%' 
    and object_type = 'TABLE';

SQL Fiddle Demo

sgeddes
  • 62,311
  • 6
  • 61
  • 83
  • Why do I prefer this answer, using `user_objects`, compared to those using `dba_objects`? Because often there are no read permissions on `dba_objects`, but on `user_objects`. – t0r0X Nov 13 '21 at 00:21
1
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
/
Art
  • 5,616
  • 1
  • 20
  • 22
0

try this

SELECT object_name tablename, created FROM dba_objects
WHERE object_name like 'DW1%'
and object_type = 'TABLE'
rs.
  • 26,707
  • 12
  • 68
  • 90