将mssql转换为mysql

时间:2018-09-06 23:14:50

标签: mysql sql-server

在将下面的mssql代码转换为mysql时,我需要帮助。当我尝试使用某些工具进行转换时,未正确转换。 ORDER BY Created OFFSET 1 ROWS FETCH NEXT 1 ROWS部分出错。请帮助我解决此问题

UPDATE A
    SET A.Status = ISNULL(  (SELECT Status_new FROM MyTable B 
                            WHERE B.[Key] = A.[Key] 
                            ORDER BY Created OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)
                        ,A.Status)
    FROM MyTable A
    WHERE Status_new IS NULL

0 个答案:

没有答案