SQL Language (MOSC)

MOSC Banner

Need Assistnace In Creating SQL to Get Data on a Quarterly Basis

edited Sep 12, 2010 8:25PM in SQL Language (MOSC) 3 commentsAnswered
 Hi Folks

looking for a little direction in trying to come up with some sql that will give me totals quarterly given a table of data

here is what i have for generating by year and by month, but i would like to generate the data quarterly:

input:

select  
   TO_CHAR (createdate,'yyyy/mm') monthofyear,
   COUNT (createdate) accountscreated
from  
   dtree
where  
   subtype=142
group by
   TO_CHAR (createdate,'yyyy/mm')
order by
   TO_CHAR (createdate,'yyyy/mm');

sample output:

Month of Year       Accounts Created
---------------- -------------------
2004/11                           89
2004/12                          207
2005/01                          112
2005/02                          322
2005/03                          185
2005/04                          163
2005/05                          213
2005/06                          164

etc, etc

any sql gurus have any handy dandy tricks ?

Thaks

jim

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center