38

I'm torn so I'm asking for input from the community. I asked a question and first, someone answered it. Pretty well and with a great image illustrating the process discussed. Awesome!

Then, someone else suggested that the question has an answer elsewhere already. After I've reviewed said alternative, I found that, sure enough, it does constitute an answer to my question.

After a few seconds of mandatory shame due to the fact that I didn't google myself to wisdom well enough, I went off to close my question as a dupe. However, the guy who posted the answer did definitely improve the answers' total set on SO and I want somehow to join his contribution with the others.

Should I close my question as a dupe or not? The question is, kind of, a dupe although with a better formulated wording. The answer, though, isn't...

(Not linking to the actual post because (a) the question is theoretical and (b) don't want to get "popular question" badges when not deserving them.)

7
  • 13
    If you got a great answer then the obvious way to do this is to the vote the old question as a duplicate. Sep 9, 2015 at 13:35
  • 1
    @HansPassant I'm not sure I understand. Do you suggest that I mark someone else's question that was asked, answered and accepted long prior to me asking as a duplicate? That sounds to me like a provocative approach. Sep 9, 2015 at 13:38
  • 2
    This is why it's important to close duplicates quickly, so that the new answer would simply have been posted to the canonical question.
    – Servy
    Sep 9, 2015 at 13:50
  • 5
    Yes. Only sending the next programmer with this problem to an inferior Q+A is provocative. If it is not inferior then flag a moderator and ask him to merge the answer. Sep 9, 2015 at 13:51
  • 24
    Duplicates aren't inherently bad, and some amount of duplication can even be good. That said, you still need to figure out which is the better duplicate target. Your question or the older one.
    – ryanyuyu
    Sep 9, 2015 at 13:52
  • Kudos to the first person to find a duplicate question on meta which doesn't have as good of an answer as this one... Sep 9, 2015 at 18:35
  • 1
    As I understand it, it's actually not uncommon to mark the older of two questions as the "duplicate" in cases where the newer question is better or has a better answer. Note that (AFAIK) closing a question has no effect on the rep or badges of anyone involved (you continue to gain rep for closed questions), so closing the old question (or any question) is not punitive; it just ensures that people who see the "inferior" one are directed to the better one. Sep 10, 2015 at 17:18

3 Answers 3

34

To add to the other answers here, you have at least the following options:

  • If the other question is good and already has good answers that fully solve your problem, just let your question be marked as a duplicate. If you feel that the answer(s) posted to your question are also good and should be rewarded, you can still upvote them and even mark one of them as accepted. As durron597 notes, your question and its answers will not be automatically deleted, and they'll even be linked from the sidebar of the other question.

  • If the two questions happen to be exact duplicates, so that the answers to your question would also make sense as answers to the other one, and if you feel that moving them to the other question would actually improve it, you can ask a ♦ mod to merge the questions by flagging you question and using the "Other..." option to explain what you think should be done and why that would be a good idea.

  • If the questions are technically duplicates, but you feel that your question is significantly better asked and has better answers, you can also counter-flag the other question as a duplicate of yours. This is a perfectly valid option, although you shouldn't overuse it — consider the other options too, and try to keep in mind that you may not always be the most objective person to judge the relative merits of the questions. If you do decide to use this option, it's often a good idea to leave a comment on the other question explaining why you feel that it should be closed as a duplicate of yours, and not vice versa.

  • Conversely, if the other question is poorly asked (e.g. full of irrelevant details), but the answers are great, you could edit the other question to improve it, and then let yours be marked as a duplicate of the edited question.

  • If both questions are reasonably well asked and answered, but the questions and answers approach the same problem from somewhat different viewpoints, that might be a sign that the questions are not really exact duplicates after all. In that case, it could be perfectly fine to let them both stay open, but linked through the sidebar. (Any link from one of the question threads to the other, even from comments, will automatically add such a sidebar link.) If someone has already voted / flagged your question as a duplicate, you may wish to post a comment explaining why you think it's different enough to stay open. Then just let the reviewers decide.

All that said, there's also one more option: find a third question that covers the same subject better than either of yours, and flag both questions as duplicates of that one.

In your case, I think this one might be the best choice — both your question and the suggested duplicate are variations on a very common question that has been asked on SO many, many times already. The "definitive" instance of your specific question is probably this one, although this and this question also cover then same topic from a more abstract viewpoint. (Some of those might themselves be dupes of each other, but again, it's perfectly fine to have a several near-duplicates of a common question, especially if all of them have good answers.)

BTW, one good way to find such "definitive" questions is to pick a few relevant keywords, put them in the search box, and sort the results by score. The best, most definitive examples of common questions tend to steadily gather upvotes, putting them near the top of the list. For example, I found the questions linked above by searching for [sql] where having count.

11

There are a few things to consider:

  • Questions closed as duplicate do not get deleted by the roomba. This means that your question (and the corresponding good answer) will not get deleted unless three users decide it's worth the trouble to spend delete votes on it, which doesn't happen that often.
  • When a question is closed as duplicate, it appears in the linked section of the duplicate target on the right sidebar. This means that anyone reading the dupe target, if they don't find the answers satisfying, can click through to see some of the duplicates.

For these reasons, it doesn't harm anything for your question to get closed as duplicate. Additionally, as @Servy says, you can flag for a moderator to merge the two questions, but this should only be done if the two questions really are exact duplicates.

2
  • "When a question is closed as duplicate, it appears in the linked section of the duplicate target" But doesn't an anonymous visitor or low rep user get HTTP redirected to the duplicate target instead of seeing the duplicate question? Sep 9, 2015 at 17:54
  • 4
    @tepples Not if there are answers.
    – durron597
    Sep 9, 2015 at 17:55
9

If you think that the new answer is of particular value not just on its own, but in addition to the existing answers to the canonical question, then you can flag the question for a mod to merge it with the duplicate, so that the answer can be moved over there. You should still mark the question as a duplicate in the meantime though.

Not the answer you're looking for? Browse other questions tagged .