Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help! What is wrong with this query
You don't say how your answers are wrong, but rounding will do it to
you by 1 or 2 MB.
why not
select tablespace_name,sum(free)/1048576 Free,sum(alloc)/1048576
from {select tablespace_name,bytes Free,0 Alloc
union select tablesapce_name,0 Free,bytes Alloc )
sjoshi_at_ingr.com (Sunit Joshi) wrote in message news:<8f8ffe67.0203260707.53018305_at_posting.google.com>...
> Hello
> I can't seem to get correct values for some of the tablespace with this query.
>
> select o.tablespace_name, round(sum(o.bytes/(1024 * 1024)),2) "Total(MB)",
> round(sum(u.bytes/(1024 *1024)),2) "FreeMB"
> from dba_data_files o, dba_free_space u
> where o.tablespace_name = u.tablespace_name
> group by o.tablespace_name;
>
> thanks
> Sunit
Received on Tue Mar 26 2002 - 14:42:31 CST