有没有人可以帮我将以下查询更改为mysql格式:
DECLARE @userTypeId INT;
SET @userTypeId = 1;
WITH tblChild AS
(SELECT *
FROM category WHERE parent_id = @userTypeId
UNION ALL
SELECT category.* FROM category
JOIN tblChild ON category.parent_id = tblChild.Id
)
SELECT *
FROM products where category_id in (select id from tblChild)
OPTION(MAXRECURSION 32767)