Получить все дочерние категории
SELECT GROUP_CONCAT(lv SEPARATOR ',') FROM (
SELECT @pv:=(SELECT GROUP_CONCAT(`id` SEPARATOR ',') FROM `warehouse_categories` WHERE `parent` IN (@pv)) AS lv FROM `warehouse_categories`
JOIN
(SELECT @pv:=4757)tmp
WHERE `parent` IN (@pv)) a;