安全云脑 SECMASTER-去重:示例

时间:2024-12-30 10:58:15

示例

根据order_id对数据进行去重,其中proctime为事件时间属性列。

SELECT order_id, user, product, number
  FROM (
     SELECT *,
         ROW_NUMBER() OVER (PARTITION BY order_id ORDER BY proctime ASC) as row_num
     FROM Orders)
  WHERE row_num = 1;
support.huaweicloud.com/usermanual-secmaster/secmaster_08_0025.html