2
I need to get the top 10 results that appear in my table and their respective percentages by groups. For example the table:
+-----+-----+
|id |fruit|
+-----+-----+
| 1 | or |
| 2 | ban |
| 3 | or |
| 4 | or |
+-----+-----+
he would have to return me something like:
+-----+-----+-----+
|COUNT|fruit|PERCE|
+-----+-----+-----+
| 3 | or | 90% |
| 1 | ban | 10% |
+-----+-----+-----+
90% because it represents 90% of the total Rows and so on
He would also have to return the name of the fruit
– Vinícius Lara
Sure, I forgot, but this is the easy part, you’re already getting the hang of adapting these things. Anyway I edited.
– Maniero
It would be wrong to ask for more help?
– Vinícius Lara
It depends on whether you are directly relating or not. Try your luck. If it’s a good thing and you didn’t have any other answers, then you could edit it to make the question complete. But it is always important to make edits that do not invalidate answers already posted. This is why it is important to think carefully before asking to include all that is needed.
– Maniero
I made the change...
– Vinícius Lara
@user3163662 I notice that you don’t often accept the answers. Is it because they don’t answer your question or because you forget? If you forget, it would be nice to review the questions you have already asked and see if you should accept any answers. This is important for the community.
– Maniero
I lose, I function differently, when I am working on a project I think about my possible future doubts and already put them for when I get in doubt can already solve it easily and with that I have several answers that help me, but lose. I’ll mark as soon as possible, thank you
– Vinícius Lara