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: SQL - How to do this group by query

Re: SQL - How to do this group by query

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 28 Jun 1999 06:49:28 +0200
Message-ID: <930545311.7079.0.pluto.d4ee154e@news.demon.nl>


replace where .. group by
by
group by
having max(read_date) < sysdate - 30

Hth,

Sybrand Bakker, Oracle DBA

<suisum_at_ecn.ab.ca> wrote in message news:3776b6ca.0_at_ecn.ab.ca...
> When I run the following SQL, I got an error:
>
> > select service_account_id
> 2 from service_consumptions
> 3 where max (read_date) < sysdate - 30
> 4 group by service_account_id
> 5 order by service_account_id;
> where max (read_date) < sysdate - 30
> *
> ERROR at line 3:
> ORA-00934: group function is not allowed here
>
> I only want to get those items which read_date is less than 30 days to the
> system date.
>
> --
> Best regards,
Received on Sun Jun 27 1999 - 23:49:28 CDT

Original text of this message

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