I am using Oracle Database which has two column lastupdate date,lastvalue
number.
lastupdate is date which has time also .i wanted grouping on hour so i wrote

SELECT  TO_CHAR(LASTUPDATE,'mm/dd/yyyy hh') lastupdate,lastvalue  FROM
intradaydata
where securities='IB Equity' GROUP BY TO_CHAR(LASTUPDATE,'mm/dd/yyyy
hh'),lastvalue

This gives me

Lastupdate                        Lastvalue
08/27/2009 10                    163.8
08/27/2009 10                    168.5
08/27/2009 10                    167.8
08/27/2009 10                    163.7
08/27/2009 10                    163.8
08/27/2009 09                    168.5
08/27/2009 09                    167.8
08/27/2009 09                    163.7


I want this(maybe sum or avg on lastvalue)

Lastupdate                       Lastvalue
08/27/2009 10                    163.8
08/27/2009 09                    163.8


Please help.

Reply via email to