dolphindb中如何在查询表时移除重复数据?

问题描述

在查询数据时,希望根据关键列将重复的数据过滤仅保留一行。

尝试过以下方法,但是均报错

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
阅读 2.3k
1 个回答

distinct函数返回单个列的唯一元素。如果要根据多列筛选重复行,请用isDuplicated函数

select * from table where isDuplicated([col1, col2], FIRST)=0
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题