Check this out. An interesting piece in today's N.Y. Times re: Who Wrote the First Detective Novel? The article is actually titled: The Case of the First Mystery Novel. I'd always thought it was Wilkie Collins with The Moonstone, but it turns out that it was yet, someone else. Technically, the first detective novel appears to have been: The serialized 8 part novel, The Notting Hill Mystery by anonymous. This debuted in Once A Week magazine beginning in November of 1862.
And since there are few secrets online, the author is no longer anonymous. Read the piece and find out who wrote the first detective mystery novel. Not Wilkie Collins, not Conan Doyle, not even Edgar Allan Poe.