1

Burninate request for

Tag description - solely a little sentence with an example.

One of the most frequent stumpers for SQL programmers is to query rows that match the greatest (or least) value over a given group. For example, all details about the City with the largest population per state. You can't do it simply with GROUP BY because the other columns will be ambiguous.

  1. Does it describe the contents of the questions to which it is applied? and is it unambiguous?

    Questions tagged with "greatest-n-per-group" do not need it as a tag at all. As in the question you would still have to specify how much data you want to return.

    It could be described as ambiguous as a question could have "I want the top 30 rows" or "I have a number which can change, I need a query which gets the top records up to that number"

  2. Is the concept described even on-topic for the site?

    Kind of, as getting the top amount of rows is still relevant to the question but would need more explanation in the question that what the tag provides itself.

  3. Does the tag add any meaningful information to the post?

    No. Like I said in #2 the question would require further information in the question as the tag on its on would not suffice.

  4. Does it mean the same thing in all common contexts?

    Yes it does, but it is still useless.

15
  • 12
    So by your own account the tag passes test 4, and the checklist says 'A tag must fail all of these tests in order to be considered for burnination', and yet here you are with a burnination request... insert hmm gif here
    – AakashM
    Commented Feb 6, 2018 at 12:41
  • 8
    @AakashM "Ideally, a good tag should meet all 4 criteria, Yakk - although as I note above, #4 isn't necessarily a good reason to get rid of a tag, merely a sign that some retagging might need to be done."Shog9♦ Mar 10 '16 at 17:07
    – Braiam
    Commented Feb 6, 2018 at 12:49
  • 5
    this is totally a meta tag. Commented Feb 6, 2018 at 13:59
  • 7
    I believe most askers do not have the slightest idea that this tag even exists. So did I.
    – svgrafov
    Commented Feb 6, 2018 at 14:20
  • @svgrafov I didn't know the tag existed till yesterday either when I saw someone using it Commented Feb 6, 2018 at 14:21
  • 18
    Missed a chance to title this question "Make [greatest-n-per-group] Great Again"
    – TylerH
    Commented Feb 6, 2018 at 15:33
  • 1
    One problem I see with this tag is that often people who ask questions that could be tagged with it don't actually know how to refer to the concept they're asking about, so wouldn't be able to find the tag even if they expected it to exist. I don't know if that's a point for or against burnination, just my observation. Commented Feb 6, 2018 at 18:23
  • 8
    The main problem with that tag is that the vast majority of questions that would be tagged with it are duplicates. There are only a few sensible approaches for this in SQL and whilst not all are available on every platform one or two canonical QAs per platform should suffice (one or two because when n is 1 there are additional options that don't apply when n is greater than 1) Commented Feb 6, 2018 at 18:31
  • 1
    But I have definitely found the existence of that tag useful when looking for duplicate targets when voting to close Commented Feb 6, 2018 at 18:37
  • how is this tag different from for-loop ?
    – jontro
    Commented Feb 6, 2018 at 20:42
  • 1
    It's not just SQL! Yes the tag is useful, but you're making a serious mistake in making it language-specific to SQL. The concept exists in most statistical data languages (R, Python/pandas), and is usually called "top-n". See Should we rename tag 'greatest-n-per-group' to 'top-n-per-group', to be consistent with 'top-n'?
    – smci
    Commented Feb 6, 2018 at 21:05
  • @MartinSmith: findability is one of many advantages, but it's a positive benefit, not just for vote-to-close.
    – smci
    Commented Feb 6, 2018 at 21:11
  • 1
    Your points #2,3 seem wrong, please justify them. The tag does add meaning. Noone said it needs to fully describe the question, no more than say bar-chart or axes do.
    – smci
    Commented Feb 6, 2018 at 21:18
  • @jontro: They're different things. a) don't tie a concept to its implementation. You can find the max or top-n with a for-loop, while-loop, recursion, sort, map-reduce etc. and b) don't tie the implementation to a language (unless necessary, which in this case seems not to be)
    – smci
    Commented Feb 6, 2018 at 21:26
  • 1
    I would say such tags are very useful. On a number of occasions I had a problem, found a question that was somewhat related, but didn't really provide an answer, but included a very specific looking tag like this one. Now I knew how to search for exactly what I needed because I saw the tag.
    – ndnenkov
    Commented Feb 8, 2018 at 7:40

4 Answers 4

20

I feel like you're not understanding the purpose of such a tag. The purpose, as I see it, is to organize questions by a certain objective, and common logic. Which this tag does.

Your argument making it "ambiguous" is that different kinds of questions, that have the same general purpose, can fit under that tag. And that's entirely the point. If all questions under greatest-n-per-group were all the same, they would all be dupes. They are not, but they do have something in common, and as Martin Smith outlined, there is common logic between them.

That makes the tag a logical collection for questions.

In point 2, you say it's kind of on-topic because the question needs further explanation. Of course a question needs further explanation than just a single tag. That's what the title and body of the question is for.

Then, you just state that it's useless. Which is very subjective.

As for people calling it a meta-tag: it isn't. Meta tags are things like difficult, homework, or other things that have little to do with the actual question, and are just information about it. This tag is descriptive for the actual objective of the question. If we limit our tags to exclude such tags, a lot of other tags should be removed as well.

I don't see any reason to burninate this tag.

14

The tag is still useful — it should not be removed.

As the question notes, the tag is used consistently to describe a fairly common group of questions that are (or should) also be tagged with the tag. As such, it is useful for identifying a related group of issues, which allows those dealing with (yet another) incoming question in the category to point to the tag as a way of finding closely related questions which have similar answers.

  1. I disagree with the analysis under point 1 in the question. There is some truth to it in that a good question could survive on its own without any tags (except that SO requires at least one). But some tags other than the primary language tag are helpful to categorize a question, and this is a helpful tag for categorizing SQL questions.
  2. I disagree with the analysis under point 2 in the question. I'm not clear why it could be considered off-topic. SQL is certainly on-topic. Within SQL, there are a group of questions that are covered accurately by this tag.
  3. I disagree with the analysis under point 3 in the question. The tag qualifies the question as asking about a particular type of issue within the overall umbrella tag; it does so succinctly, and usefully.
  4. The analysis in point 4 undermines the burnination request.

It is not, IMO, a tag that warrants removal. If it warrants removal, there are thousands of other tags that warrant removal far more urgently.

14

Yes the tag is useful, but it's not just SQL, you're making a serious mistake in keeping it language-specific to SQL. The concept exists in most statistical data languages (R, Python/pandas), and is usually called top-n. See Should we rename tag 'greatest-n-per-group' to 'top-n-per-group', to be consistent with 'top-n'?, where I previously advocated in favor of a language-neutral tag (sadly SO doesn't support tag aliasing. The next best alternative is for descriptions of alias tags to crossreference each other : "...See also the SQL tag greatest-n-per-group)

See comment by @Bulat, it illustrates the difficulty in users finding this tag: "I find it difficult to find this tag sometimes. I would rather just use a more generic n-per-group, as usually in questions it refers to first/ greatest..."

6

You grossly underestimate how useful this tag is in communicating the contents of a question.

In the context of SQL Server if I see this tag then I know I would just need to know answers to the following.

  1. What is the value of n?
  2. How should ties be treated?
  3. Number of rows on average per group.
  4. Available indexes

And then more or less formulaicly consider

  • ROW_NUMBER/RANK
  • APPLY and TOP (potentially WITH TIES)
  • Recursive CTE to simulate skip scan

If N = 1 some additional options

But I would also know that the question is bound to be a duplicate so the main utility the tag has for me at the moment is helping find an appropriate one.

You must log in to answer this question.

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