I have written a procedure in MySql here:
CREATE DEFINER = 'root'@'localhost'
PROCEDURE bbet.Proc_transactiontable_Get(IN in_userID varchar(36),
IN in_page int,
IN in_amountPerPage int,
IN in_serviceID varchar(36))
BEGIN
SET @offset = ((in_page-1)*in_amountPerPage);
SELECT t.TransactionID, t.UserID, t.ServiceID, t.MatchID, t.AmountMoney, t.CreatedDate, t.Staus, t.TotalMoney, t.Fee FROM transactiontable t
WHERE t.UserID = COALESCE(in_userID, t.UserID) AND t.ServiceID = COALESCE(in_serviceID, t.ServiceID)
LIMIT in_amountPerPage
OFFSET @offset;
END
But it has syntax error on line: "OFFSET @offset". How to handle this problem?