row_number()开窗函数问题

【详述】想取开窗函数分组后的第一条记录的数据
【StarRocks版本】emr的starrocks 2.3版本
【附件】

sql 的执行顺序 where 是在 select 之前的,执行顺序:from ->join->on->where->group by->avg,sum->having->select->distinct->order by.group by开始才能使用select中的别名。需要在外面再套一层查询,例:select * from ( select x, y, row_number() over( partition by x order by y ) as rank from int_t ) a where a.rank=1;

2赞

老师 还有其他写法吗 比如用window字句 可以 只取第一行吗 rows between 1 and 1

除了子查询还有其他办法吗