Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Help

Re: SQL Help

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 12 Aug 2002 16:16:02 GMT
Message-ID: <3D57DF41.8540AAF3@exesolutions.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US