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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Complicated SQL

Re: Complicated SQL

From: Lun Wing San (Oracle) <wslun_at_qrcsun.qrc.org>
Date: 1997/02/14
Message-ID: <330483DF.6A80@qrcsun.qrc.org>#1/1

Jack C. Holt wrote:

> I have a database that contains diskspace needed for for various
> projects with start and stop date fields. I want to create one SQL
> statement that will return the sum of diskspace used by month for the
> next year.
>
> Can SQL do this and can you write me an example statement?

  It will be similar to the following:

  select sum(diskspace)
  from tablename
  group by to_char(startdate, 'mmyyyy')

  I assume your startdate and the stopdate lie on the same month and the same year. Otherwise, you cannot determine how much proportion of the diskspace used.

---
Name   : Lun Wing San
Title  : Oracle Application Developer of Hong Kong Productivity Council
         Oracle Database Administrator and System Administrator of QRC
Phone  : (852)27885841

This posting represents the personal opinions of the author. It is not the
official opinion or policy of the author's employer. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Fri Feb 14 1997 - 00:00:00 CST

Original text of this message

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