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

Home -> Community -> Usenet -> c.d.o.server -> Any query specialist? you have a challenge

Any query specialist? you have a challenge

From: Kumar <ksskumar2000_at_gmail.com>
Date: 4 Apr 2006 04:41:40 -0700
Message-ID: <1144150900.039053.67560@z34g2000cwc.googlegroups.com>


Hi friends,

I have a table like,

CustNo	NoOfOrders	Month	Year
1	1		2	2006
1	5		1	2006
1	8		8	2005
1	12		6	2005
2	3		12	2005
2	8		3	2006
2	2		1	2006
2	9		10	2005
2	11		11	2005

I need a sql statement to produce a output like,

		(no of orders between this month range------------------------->)
CustNo		1_to_3_month_ago 	4_to_6_months_ago	7_to_12_months_ago
1		6			8			12
2		10			23			0


assume query execution date is today (4th April 2006). NOT through PL/SQL. thanks in advance Received on Tue Apr 04 2006 - 06:41:40 CDT

Original text of this message

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