MongoDB查询语句 --查询近三个月的客户使用量 aggregate:使用聚合 match:过滤 group分组 -- mysql中select org_code as 近三个月使用商户 from pomelo_backend_production.landi_configurations where created_at between '2018-03-22 00:00:00' and '2018-06-22 00:00:00'GROUP BY org_code; --mong…
1.查询所有记录db.userInfo.find();相当于:select* from userInfo; 2.查询去掉后的当前聚集集合中的某列的重复数据db.userInfo.distinct("name");会过滤掉 name 中的相同数据相当于:select distict name from userInfo; 3.查询 age = 22 的记录db.userInfo.find({"age": 22});相当于: select * from userInfo…
1.查询所有记录 db.userInfo.find();相当于:select* from userInfo; 2.查询去掉后的当前聚集集合中的某列的重复数据db.userInfo.distinct("name");会过滤掉 name 中的相同数据相当于:select distict name from userInfo; 3.查询 age = 22 的记录db.userInfo.find({"age": 22});相当于: select * from userInf…
SELECT DISTINCT CONCAT('User: ''',USER,'''@''',HOST,''';') AS QUERY FROM mysql.user; GRANT USAGE ON *.* TO 'user01'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;…
左边是mongodb查询语句,右边是sql语句.对照着用,挺方便. db.users.find() select * from users db.users.find({"age" : 27}) select * from users where age = 27 db.users.find({"username" : "joe", "age" : 27}) select * from users where "us…