oraccle 的row_number() over(partition by userid order by enddate DESC) 在mysql中替换方案
oraccle 中的row_number() over(partition by userid order by enddate DESC) 很实用,能分组排序后拿每个的第一条。在mysql中没对应的方法,再网上找了很多篇文章后,发现可以用变量来模拟,比如再oracle中:
select tc.* from (select t.,row_number() over(partition by t...
原创
2019-08-09 15:36:45 ·
843 阅读 ·
0 评论