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
请先 登录 后评论

1 个回答

Jason Tang - 时序数据库技术支持

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

select * from table where isDuplicated([col1, col2], FIRST)=0
请先 登录 后评论