在最近的项目中遇到了mysql 8.0版本中row_number()函数在迁移数据库低版本mysql5.0版本无法使用的问题。具体sql如下:
1 SELECT DATE(a.CRETIFICATE_DATE) AS NAME, COUNT(*) AS COUNT FROM 2 (SELECT CERTIFICATE_DATE, ENABLED, CERTIFICATION_STATE, ROW_NUMBER() over (PARTITION BY PROJECT_ID ORDER BY CERTIFICATE_DATE ASC) AS CENTER_NUM FORM CERT_CERTIFICATE ...... 3 4 ) a 5 WHERE a.CENTER_NUM = 1
参考以下两个博文找到了解决方案:
https://www.cnblogs.com/wangbin2188/p/16857255.html
https://www.cnblogs.com/icebutterfly/archive/2009/08/05/1539657.html
标签:CERTIFICATE,适配,number,低版本,DATE,row From: https://www.cnblogs.com/yif0118/p/18139535