SQL Language (MOSC)

MOSC Banner

This query with decode and group by is duplicating me the tablespace name - I don't want that

edited Jan 13, 2012 1:55AM in SQL Language (MOSC) 9 commentsAnswered
Hi experts.Happy New Year !
This query is duplicating the tablespace name.
Any ideas?

SQL> select tablespace_name, decode(autoextensible,'NO',sum(bytes)/(1024*1024*1024),sum(maxbytes)/(1024*1024*1024)-sum(bytes)/(1024*1024*1024))GB  from dba_data_files group by tablespace_name,autoextensible;

TABLESPACE_NAME         GB
--------------- ----------
USERS            .85546875
USERS            .74609375
SYSTEM          .732421875
DM_DATA         246.115234
DM_DATA         54.4433594
DM_INDX         229.999023
DM_INDX         55.0439453
UNDOTBS         112.798828
UNDOTBS          17.578125
VA_DATA         29.2998047
VA_DATA         .122070313
VA_INDX         32.2548828
VA_INDX         14.6484375
ODS_DATA        605.519531
ODS_INDX        150.893555

15 rows selected.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center