select custid,carid,Cunote,INVNO,BUYPLAN
from ( select custid,carid,Cunote,INVNO,BUYPLAN,
row_number() over(partition by custid,carid order by Feedbackid desc) rn
from pvE3S.T_VCTM_CUSTOMER_FEEDBACK) t1 where rn=1
按Feedbackid 排序,rn是前N行
from ( select custid,carid,Cunote,INVNO,BUYPLAN,
row_number() over(partition by custid,carid order by Feedbackid desc) rn
from pvE3S.T_VCTM_CUSTOMER_FEEDBACK) t1 where rn=1
按Feedbackid 排序,rn是前N行
本文介绍了一种使用SQL进行数据查询的方法,通过子查询和窗口函数row_number()实现了对特定字段(如Feedbackid)的排序,并选取了每个客户和车辆组合下的最新反馈记录。
948

被折叠的 条评论
为什么被折叠?



