All Forums Database
Ashu 4 posts Joined 07/06
26 Jul 2006
How to fetch chunks of data in Teradata

Hi,I have a very urgent requirement.There are some millions of records in one of my Teradata tables.Now I need to process these records by fetching 10000 records at a time.For example- say in the first pass I pick up 10000 records and put them in a flat file,process it. Then in second pass pick next 10000 records put in a flat files process it and so on until all my records in the table gets processed.Any solution to this problem would be really helpful.Thanks,Ashish.

vinod_sugur 22 posts Joined 04/05
28 Jul 2006

I would suggest to fetch the rows by using analytical function i.e Row_Number() Select *From (select Row_number() OVER(Order by day_of_calendar) val, day_of_calendar, calendar_date from sys_calendar.calendar) xWhere val between 1 and 20=======Select *From (select Row_number() OVER(Order by day_of_calendar) val, day_of_calendar, calendar_date from sys_calendar.calendar) xWhere val between 21 and 40

You must sign in to leave a comment.