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

Home -> Community -> Usenet -> c.d.o.tools -> Re: GROUP BY

Re: GROUP BY

From: Jerry Gitomer <jgitomer_at_p3.net>
Date: 1998/03/13
Message-ID: <3508CD7A.2E2D@p3.net>#1/1

Hi Koen,

Based on your query you are only selecting one day (sysdate - 1). If this is what you want to do change the group by to

        GROUP BY host_id

Regards

Jerry

Koen Serry wrote:
>
> our table looks like this
>
> CREATE TABLE pagehits
> (
> host_id NUMBER(3) NOT NULL,
> url_id NUMBER(5) NOT NULL,
> datum DATE NOT NULL,
> aantal NUMBER(8) DEFAULT 0
> )
>
> we're trying to select data grouped by "day"
> what's wrong with this
>
> 'SELECT sum(aantal)
> FROM pagehits
> WHERE (datum = (SYSDATE-1))
> AND (hostid(host)=host_id)
> GROUP BY datum date(50) "dd/mon/yyyy"
>
> regards,
>
> Koen & Bart
 

-- 
Jerry Gitomer		Since I know how to spell DBA I became one. 
jgitomer_at_p3.net
Received on Fri Mar 13 1998 - 00:00:00 CST

Original text of this message

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