In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to achieve the Excel grouping and sorting function in MySQL. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
1. There is a data sheet tmp_provice_sales as follows: the table records the sales volume of cities in a commodity province, and now you need to extract the city data of TOP1 sales in each province.
2. Then enter the following code in the query box:
3. Click "run" to obtain the sales TOP1 data of each province. The running result is shown below:
The points to be noted are:
The sales of the original data source need to be sorted in descending order, order by provice, sales desc, and the data of the same province are arranged together, and the sales volume is arranged from large to small.
Then use the if function to add the serial number to the data
Extract the data ranked 1 in each group, that is, the demand data.
If you want to get top3 data, just modify the last sentence, having ranks
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.