In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
To put it simply, distinct is used to remove weight, while group by is designed to aggregate statistics. There are some similarities in the functions that can be achieved, but they should be carefully distinguished.
Simple deduplication operation using distinct, the speed is faster than group by.
Distinct supports single-column and multi-column deduplication.
The way to remove duplicates in a single column is simple and easy to understand, that is, only one of the same values is retained.
The deduplication of multiple columns is based on the specified deduplicated column information, that is, only all the specified column information are the same, it will be considered duplicate information.
Group by is used relatively frequently, but like its function, its purpose is to aggregate statistics, although it is also possible to achieve deduplication, but this is not its strong point.
Difference:
1) distinct simply takes duplicate rows out of the result
Group by is grouped by specified columns, and aggregate functions are usually used in select.
2) distinct shows different records.
Group by first classifies the records by category before querying.
Group by must include an aggregate function in the query results, but distinct does not.
This is the end of this article on the difference between distinct and group by in Mysql. For more information about the difference between distinct and group by, please search the previous articles or continue to browse the relevant articles below. I hope you will support it in the future!
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.