-- opengid_base_data 原始分享数据样例
-- 每个渠道取 20 条记录，只看 usersharedepth = 0（原始分享）

SELECT  *
FROM    (
            SELECT  *
                    ,ROW_NUMBER() OVER (PARTITION BY channel ORDER BY 点击时间 DESC) AS rn
            FROM    loghubods.opengid_base_data
            WHERE   dt = ${start}
            AND     usersharedepth = 0
        ) t
WHERE   rn <= 20
;
