1

我需要帮助将这部分存储过程从 MSSQL 转换为 MYSQL,任何建议都值得赞赏。

Ps对不起我的英语

     set @PARAMS = '@DATA_INIZIO VARCHAR(20), 
           @DATA_FINE VARCHAR(20), 
           @SEDE VARCHAR(10)'


 set @CMD = 'WITH DriversRN AS
    (
        SELECT ROW_NUMBER() OVER(ORDER BY '+ @ORDER_BY_RN +') as ROW_NUM, * FROM digitalpodcontrol 
        WHERE Date BETWEEN @DATA_INIZIO AND @DATA_FINE AND Depot = @SEDE
    )
    SELECT * FROM DriversRN
    WHERE ROW_NUM BETWEEN ' + CONVERT(VARCHAR(50),@MIN__VALUE) + ' AND ' + CONVERT(VARCHAR(50),@MAX__VALUE) + ' 
    ORDER BY ' + @ORDER_BY + ' ' + @DIRECTION

    EXECUTE sp_executesql @CMD, @PARAMS, @DATA_INIZIO, @DATA_FINE, @SEDE
4

0 回答 0