dolphindb - 如何从 dolphindb 表中删除重复行?
问题描述
如何从 DolphinDB 的表中选择不重复的行数据?我distinct
在手册中找到了该功能。我尝试了下面的代码,但不起作用。
select distinct(col1,col2) from table
=====================================
The function [distinct] expects 1 argument(s), but the actual number of arguments is: 2
select distinct([col1,col2]) from table
=====================================
The argument for 'distinct' must be a typed vector
似乎 distinct 只能应用于一列。有什么解决办法吗?
解决方案
该函数distinct
返回单个列的唯一元素。如果你想根据多列过滤掉重复的行,强烈推荐function isDuplicated
,它是在DolphinDB 0.99版本中引入的。
select * from table where isDuplicated([col1, col2], FIRST)=0
推荐阅读
- javascript - 从 vuex 存储操作中传递对象
- ios - 如何在本机反应中获取更新的设备令牌?
- javascript - Javascript AJAX 未执行
- python - Cv2 说“找到相机”,即使它没有
- haskell - GHCI:测试套件的 ghc-options 覆盖库的 ghc-options
- python - 如何在 python Dataframe 中提高以下代码的性能,如果可能,请提及复杂性的顺序:
- android - 如何在 android 中使用 2 spinner 进行 fpersonal orm?
- javascript - 如何修复来自多个复选框的请求输入字母字符?
- javascript - 使用具有不同标签的 Objetcs 中的数组对数组进行求和
- javascript - 当前使用 Laravel 和 Stripe Checkout 进行单次付款的方法是什么?