posted 12 years ago
Martin, I did try the approach you suggested,
But please do look at the timestamp field, its always going to be unique.So its necessary for me to convert timestamp to Date.
>>1) Declare a variable to hold last processed date. Initialize it to some value which is guaranteed not to occur in the processed rows.
Just for clarification, its insert time along with date.Its mysql timestamp field. Lets say I initialized it to current date thats is 2012-07-23.
>>3a) Whenever the current record's date differs from the last processed date, print out the date header and store the new date into the last processed date variable.
again lets say that there is some inserts from 23th july morning, so its alway going to find some values.So lets change to change value to null, since its nonnull field, I am sure we will not come across this value. Then I run the query
Select Date(ctimestamp),title from table A Limit 100;
I loop through this resultset and compare Date with null value, so for each comparision its not going to match,so I have timestamp/title getting added to list for each loop.In this list I will have many duplicates records coming up something
Date1, title1,Date1,title2,Date1,title3..
This is not what I require.I need for each Date1, It should have records title1,title2,title 3 etc.
If my understanding is incorrect, can you give me some tips as how what values should I use to initialise date variables.
I think getting less data from DB helps in first place then doing processing on the code and limit processing records to 100.Thats the reason I use Limit.