Loop in SQL
Ora_bieMay 26 2010 — edited May 27 2010Hi Fellows,
I am looking for using loop in my sql query and wondering how this can be done. Actually ,I want to draw monthwise data from my database , based upon the from_month and to_month I would be getting from the user. To explain my required SQL, I take the help of an example:
For example If I get from_month as Jan 2010 and to_month as March 2010 from the user,via some application like USER PARAMETERS of Oracle Report, then this sql should execute monthwise data of Jan 2010, Feb 2010, and March 2010 of ,say, number of claims received in the respective months. But of the it has Dec 2009 for from_month then it would cover data of DEC 2009 also in this report.
How can I build this kind of SQL and what keywords would be helping me in this?
Please feel free to ask if you need more light on this. Thanks in advance.
HP