In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Let's learn about how to use distinct in mysql to remove duplicate records. I believe you will benefit a lot after reading it. The text is not much in essence. I hope you want to use distinct in mysql to remove repeated records.
A duplicate record is a record in which all fields are the same after distinct.
For example: suppose that in a multi-store version of the mall system, there is a table that records sales records, recording every sales volume of each store. As follows:
Running the query below, and then comparing the results separately, it is not difficult to find that distinct is the removal of duplicate records.
The first query, select distinct uid from sale_log;, screened out shopkeepers with sales.
The second query, select distinct uid,store_id from sale_log;, screened out the different stores of shopkeepers with sales. It is obvious that the result of this query is to filter out records that are the same as uid and store_id, rather than taking it for granted that as long as fields are modified by the distinct keyword, there will be no duplicate values.
Finally, again, distinct works on the entire query, not on the fields that follow it.
After reading this article on how to use distinct in mysql to remove repeated recording, many readers will want to know more about it. For more industry information, you can follow our industry information section.
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.