Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Any query specialist? you have a challenge
Kumar wrote:
>
> 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.
Not really much of a challenge. You should be able to manage it
yourself after reading about case and sum in the SQL Reference manual.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm#i1033392
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions163.htm#i89126 Received on Tue Apr 04 2006 - 07:06:11 CDT