select * from categories ...................... where categories.id = 3;
WITH RECURSIVE recursive_categories (name, parent_id) AS (
SELECT name, parent_id FROM categories WHERE name = 'PHP developer'
UNION ALL
SELECT c.name, c.parent_id FROM categories c JOIN categories ON c.id = categories.parent_id
) SELECT * FROM recursive_categories
ORDER BY parent_id ASC;