A common feature is that the investigator is usually unmarried, with some source of income other than a regular job, and frequently has an assistant, who is asked to make all kinds of apparently irrelevant inquiries, and acts as an audience for the explanation of the mystery at the end of the story.
An early archetype of these types of story were the three Auguste Dupin stories of Edgar Allen Poe: The Murders in the Rue Morgue, The Purloined Letter, and The Mystery of Marie Roget. This last is particularly interesting, as it is a scarcely fictionalized analysis of the circumstances around the real-life discovery of the body of a young woman named Mary Rogers, in which Poe expounds his theory of what actually happened. The style of the analysis, with its attention to forensic detail, makes it a precursor of that most famous of all fictional detectives, Arthur Conan Doyle's Sherlock Holmes, who set the style for many, many others in later years, including pastiches such as August Derleth's Solar Pons.
The full list of fictional detectives would be immense; the format is well suited to dramatic presntation, and so there are also a large number of televison and film detectives, besides adaptation of novels in this genre.
A few examples of fictional detectives, and their creators:
Perhaps some mention is needed of Wilkie Collins' The Moonstone as an early detective novel?