From: manamala on
I am trying to retrieve historical data for simulation from our database (oracle). I can get data for a given date using the conn and fetch database functions. However, how do I get data for 30 days for each month. i.e for each date, I have ab out 60 data points, starting from Feb 2010 to Dec 2014. I need 30 historical prices for each datapoint. How do I go about getting this? Please help. I am pretty new to database tools. This is what I have right now.

conn = database('PHCI_PROD','readonly','access2');
curs = exec(conn, 'SELECT ALL PRODUCT_C,DELIVERY_MONTH,PRICE FROM ETRADE_APP.PAR_PRICE_CURVE WHERE PRODUCT_C = ''''AND PRICE_DATE = ''05-January-2010''');
curs = fetch(curs);
setdbprefs('DataReturnformat','structure');