我在Sql server下面有以下存储过程,我需要转换成My sql ..请帮我怎么做?
CREATE PROCEDURE [dbo].[Getsomething_data]
-- Add the parameters for the stored procedure here
@UserID nvarchar(250),-- from 10 to 14
@Limit varchar(10),
@Offset varchar(10),
@Fields varchar(max)
AS
BEGIN
declare @dynamicQuery as varchar(4000)
set @dynamicQuery = '
with cte
as
(
SELECT top (10000000000000) ROW_NUMBER() over(Order By CreateddateTime Desc) as rownum ,' + @Fields + '
FROM SMSDetails where UserID =''' + @UserID + ''' and IsDeleted=0 and TypeOfMassage=''S''
)
select * from cte where (rownum between ' + @Offset +' and ' + @Limit + ')'
exec(@dynamicQuery)