Home » SQL & PL/SQL » SQL & PL/SQL » need help!!
need help!! [message #20159] Thu, 02 May 2002 11:33 Go to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
I need to create a view that will return the average number of events taking place in august. not for a specific year, for all years in the database. any suggustions?
Re: need help!! [message #20160 is a reply to message #20159] Thu, 02 May 2002 12:02 Go to previous messageGo to next message
Jon
Messages: 483
Registered: May 2001
Senior Member
Something like this should do it...

select events/years events_in_aug
from
(select count(*) events from event_table where to_char(event_date,'MM') = '08'),
(select count(distinct(to_char(event_date,'YYYY'))) years from event_table where to_char(event_date,'MM') = '08')
;
Re: need help!! [message #20179 is a reply to message #20160] Fri, 03 May 2002 23:19 Go to previous message
srinivasarao
Messages: 15
Registered: April 2002
Junior Member
your answer is quiet right
i am very interested by seeing this query
very nice

it will help me in different ways

friend

srinivasarao.p
Previous Topic: Index attributes
Next Topic: reducing size of a database
Goto Forum:
  


Current Time: Fri Apr 26 16:02:59 CDT 2024