Home » SQL & PL/SQL » SQL & PL/SQL » Quarterly data shown (oracle 10g)
Quarterly data shown [message #581538] Mon, 08 April 2013 13:07 Go to next message
Messages: 269
Registered: December 2009
Location: Mumbai
Senior Member


i want to show data quarterly.

My quarter structure is 3 mOnths.

q1 - apr-2013 to jun-2013
q2 - jul-2013 to sep-2013
q3 - oct-2013 to dec-2013
q4 - jan-2014 to apr-2014

I input parameter is from date and to date..

Suppose user enter from date - '01-apr-2012' and to date - '01-aug-2012',
only q1 shows..

and user enter from date - '01-apr-2012' and to date - '30-sep-2012',
only q1,q2 shows..

how i do that..

My data is like this

create table t1( t1_month VARCHAR2(10),
                 t1_val1 number(10),
                 t1_val2 NUmber(10)

INSERT INTO t1('APR-13',100,200);
INSERT INTO t1('MAY-13',100,200);

INSERT INTO t1('JUN-13',100,200);

INSERT INTO t1('JUL-13',100,200);

INSERT INTO t1('AUG-13',100,200);

INSERT INTO t1('SEP-13',300,200);

INSERT INTO t1('OCT-13',400,200);

INSERT INTO t1('NOV-13',100,300);

INSERT INTO t1('DEC-13',100,200);

INSERT INTO t1('JAN-14',500,200);

INSERT INTO t1('FEB-14',600,200);

INSERT INTO t1('MAR-14',100,200);

Re: Quarterly data shown [message #581539 is a reply to message #581538] Mon, 08 April 2013 13:24 Go to previous messageGo to next message
Michel Cadot
Messages: 65084
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And what happens if t1_month is 'MICHEL'?


[Updated on: Mon, 08 April 2013 13:24]

Report message to a moderator

Re: Quarterly data shown [message #581546 is a reply to message #581538] Mon, 08 April 2013 15:33 Go to previous message
Messages: 4758
Registered: February 2005
Location: East Coast USA
Senior Member
q4 seems to be 4 months, not 3.
Previous Topic: Query to generate SET NEWNAME command
Next Topic: Compare Columns of two table
Goto Forum:

Current Time: Fri Jul 21 23:55:57 CDT 2017

Total time taken to generate the page: 0.22881 seconds