In the crysatl report i am writing a query like these its taking more than - TechRepublic
Question
February 8, 2010 at 12:00 AM
naveenaraj

In the crysatl report i am writing a query like these its taking more than

by naveenaraj . Updated 16 years, 4 months ago

n the crysatl report i am writing a query like these its taking more than hour to exectue query is follows:
SELECT ‘Average Daily Traffic Volume’,TD.TIMESTAMP,(SUM(TDV.vehicle_volume)/(TO_NUMBER(TO_CHAR(LAST_DAY(td.TIMESTAMP),’dd’)))) AverageVolume
FROM TRAFFIC_DATA_VOLUME TDV,TRAFFIC_DATA TD
WHERE TDV.traffic_Data_id = TD.ID AND (TO_NUMBER(TO_CHAR(td.TIMESTAMP,’MM’))
BETWEEN {?Month1}-2 AND {?Month1})
AND TO_NUMBER(TO_CHAR(td.TIMESTAMP,’YYYY’))={?Year1}
GROUP BY TD.TIMESTAMP

please suggest to modify the query
data base having more than million records

This discussion is locked

All Comments