PDA

View Full Version : store filter function with group by



raj_plays
28 Apr 2011, 12:26 PM
Hi,
My store has the following records..


FreeEntry = Ext.data.Record.create([{
name: 'timestamp',
type: 'date',
dateFormat: 'Y-m-d\TH:i:sP'
}, {
name: 'phone',
type: 'string'
}, {
name: 'keyword',
type: 'string'
}, {
name: 'status',
type: 'string'
}]);

I want to apply a filter to the store that will give me the records with the latest timestamp value for each phone number.
something like the sql ... select phone, max(timestamp) from table group by phone

Help please me write the filter function.