I have data base in which i am storing source address,destination address and category. Now i want to show only last 10 data stored in that data base on table view. I am using this code for retrieving data form data base...

```
 -(void) openDB {

listOfStudents = [[NSMutableArray alloc] init];
if(sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
    const char *sql = "select * from Places";
    sqlite3_stmt *stmt;
    int rtnVal = sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);
    if( rtnVal == SQLITE_OK) {
        while (sqlite3_step(stmt) == SQLITE_ROW) {
            Places_data *pd_object = [[[Places_data alloc] init] autorelease];
            pd_object.place_id = sqlite3_column_int(stmt, 0);
            pd_object.start_add = [NSString stringWithUTF8String:(char *) sqlite3_column_text(stmt, 1)];
            pd_object.end_add = [NSString stringWithUTF8String:(char *) sqlite3_column_text(stmt, 2)];
            pd_object.strcategroy =  [NSString stringWithUTF8String:(char *) sqlite3_column_text(stmt, 3)];

            [self.listOfStudents addObject:pd_object];
        }
    }
    sqlite3_finalize(stmt);
}
sqlite3_close(db);

```

}

Now what i do changes in above code show that it show only last 10 results in table view?