Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - How to do this group by query
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
![]() |
![]() |