Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Help
Joe Philip wrote:
> I want to find the free space and used space from a database. I wrote the
> following sql but does not work:
>
> select sum(a.bytes) free, sum(b.bytes) used
> from dba_free_space a, dba_segments b
> where a. tablespace_name=b.tablespace_name
> group by a.tablespace_name
> /
>
> What am I doing wrong?
A number of things. But the most obvious is that you did not post the error message or the version which should be a standard part of every posting.
In this case the most obvious problem is that you have a GROUP BY clause and nothing being grouped.
Group by would only be of value if you rewrote your query in this form:
select A.TABLESPACE_NAME, sum(a.bytes) free, sum(b.bytes) used
from dba_free_space a, dba_segments b
where a. tablespace_name=b.tablespace_name
group by a.tablespace_name
/
Daniel Morgan Received on Mon Aug 12 2002 - 11:16:02 CDT
![]() |
![]() |