HuangYuChen1998 opened a new issue, #17635:
URL: https://github.com/apache/iotdb/issues/17635

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and 
found nothing similar.
   
   
   ### Version
   
   版本:V2.0.8
   系统 Windows 11
   
   ### Describe the bug and provide the minimal reproduce step
   
   SQL 如下:
   ```sql
   select
       "time",
       symbol,
       display_name,
       close_hfq,
       RANK() OVER (ORDER BY "time" ASC) AS rank_time,
       RANK() OVER (ORDER BY close_hfq ASC) AS rank_close
   FROM quant.stock_kline_weekly
   WHERE "time" >= 2026-04-11
   AND symbol = '600000'
   ORDER BY rank_close ASC;
   ```
   
   <img width="1118" height="512" alt="Image" 
src="https://github.com/user-attachments/assets/49cb3e23-f116-4f8b-b557-23e731fd5390";
 />
   
   在一个SELECT中有多个开窗函数时(如 RANK),后续开窗函数的统计结果总是第一个开窗函数的结果;
   如图片中所示:按 close rank的话得出的顺序完全是反的,这个结果总是和第一个rank一致(这里是time);
   
   ### What did you expect to see?
   
   每个RANK在计算时是根据其自身的条件来计算的
   
   ### What did you see instead?
   
   总是取自第一个RANK
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to