MySQL5.7升级到8.0(一):SQL语法变化

Note:这里面是升级到8.0,需要开发人员参与修改部分或注意部分

对业务有影响的关键字有: ‘CUME_DIST’,‘DENSE_RANK’,‘EMPTY’,‘EXCEPT’,‘FIRST_VALUE’,‘GROUPING’,‘GROUPS’,‘JSON_TABLE’,‘LAG’,‘LAST_VALUE’,‘LATERAL’,‘LEAD’,‘NTH_VALUE’,‘NTILE’,‘OF’,‘OVER’,‘PERCENT_RANK’,‘RANK’,‘RECURSIVE’,‘ROW_NUMBER’,‘SYSTEM’,‘WINDOW’

附: 我们查表/字段是否用到8.0关键字的SQL

select c.linkname,c.dbver,b.dbname,a.table_name,a.COLUMN_NAME from info_columns  a 
join linkdb b on a.dbid=b.dbid 
join linkset c on b.linkname=c.linkname
  where  length(IS_NULLABLE)>1 and 
(
table_name in ('CUME_DIST','DENSE_RANK','EMPTY','EXCEPT','FIRST_VALUE','GROUPING','GROUPS','JSON_TABLE','LAG','LAST_VALUE','LATERAL','LEAD','NTH_VALUE','NTILE','OF','OVER','PERCENT_RANK','RANK','RECURSIVE','ROW_NUMBER','SYSTEM','WINDOW')  

or
COLUMN_NAME in ('CUME_DIST','DENSE_RANK','EMPTY','EXCEPT','FIRST_VALUE','GROUPING','GROUPS','JSON_TABLE','LAG','LAST_VALUE','LATERAL','LEAD','NTH_VALUE','NTILE','OF','OVER','PERCENT_RANK','RANK','RECURSIVE','ROW_NUMBER','SYSTEM','WINDOW')  

)

and c.appuse=9

and c.dbver not like '8%'

>> Home

51ak

2022/02/14

Categories: mysql mysql8.0 mysql升级 Tags: 原创

《数据库工作笔记》公众号
扫描上面的二维码,关注我的《数据库工作笔记》公众号