how to count unique entries in database

Show your code…