extractor function

Extract rows of a database in count form