Tag:distinct
-
Time:2020-11-14
For example, there is a personnel table (Table Name: peosons)If you want to record the name, ID number and address of the three fields exactly the same, Copy codeThe code is as follows: select p1.* from persons p1,persons p2 where p1.id<>p2.id and p1.cardid = p2.cardid and p1.pname = p2.pname and p1.address = p2.address The above […]
-
Time:2020-7-15
Some people put forward such a question, sort it out for everyone to refer to Suppose there is a table like this: The data here has the following characteristics: in a departmentid, there may be multiple names, and vice versa. In other words, the relationship between name and departmentid is many to many. Now you […]
-
Time:2020-2-19
1. count: Copy codeThe code is as follows: — in an empty collection, count returns 0. > db.test.count() 0— test the return value of count after inserting a document. > db.test.insert({“test”:1}) > db.test.count() 1 > db.test.insert({“test”:2}) > db.test.count() 2— count, like find, accepts conditions. From the results, […]
-
Time:2019-12-19
In the previous article, we introduced the detailed explanation of the data aggregation method implemented by MapReduce in mongodb. We mentioned a way of data aggregation operation in mongodb – MapReduce, but in most daily use processes, we do not need to use MapReduce for operation. In this article, we will briefly talk about the […]
-
Time:2019-8-1
Preface When it comes to the de-duplication of sets, the first thing that comes to mind is Linq’s Disinct extension. For the general set of value types, de-duplication is a good way to deal with, just list. Distinct (). But if you want to de-duplicate a collection of reference types (duplicate if all attribute values […]