【问题标题】:Equivalent of "select distinct on" in mongodb相当于mongodb中的“select distinct on”
【发布时间】:2021-04-21 15:03:38
【问题描述】:

我想知道mongodb 是否具有与select distinct on 等价的函数,如sql。 例如,如果我在Sql 中有此查询:

SELECT DISTINCT ON (department) * FROM employees
ORDER BY department, salary DESC;

我怎样才能在mongodb 中做同样的query? 对于mongodb,我使用python 和pymongo

【问题讨论】:

    标签: python sql mongodb mongodb-query pymongo


    【解决方案1】:
    猜你喜欢
    • 2011-07-11
    • 2018-08-10
    • 1970-01-01
    • 2017-01-25
    • 2012-03-28
    • 1970-01-01
    • 2021-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多