为MySQL DDL语句转换row_number()函数

时间:2019-01-19 10:47:03

标签: mysql db2 aws-sct

我正在尝试将在DB2上生成的以下ddl语句运行到mysql。但是,它给我的错误是MySQL上不存在row_number()。

有人可以告诉我如何在mysql中模拟吗?

查询

CREATE VIEW "MY_PORTAL"."MyView" AS SELECT ROW_NUMBER() OVER() AS id, b.id batch_id, 
b.name batch_name, b.description batch_desc, b.status batch_status, b.classname batch_classname, 
b.active batch_active, b.server batch_server, s.id scheduler_id, s.typeid scheduler_type_id, 
str.typename scheduler_type_name, s.days scheduler_days, s.hours scheduler_hours, s.minutes scheduler_minutes, 
s.seconds scheduler_seconds FROM myDB.batches b LEFT OUTER JOIN myDB.schedulers s 
ON s.batchid = b.id LEFT OUTER JOIN myDB.scheduler_type_ref str ON str.typeid = s.typeid;

0 个答案:

没有答案