Edit: this is only supported by Sybase SQL Anywhere, not by the "professional" Adaptive Server Enterprise.
According to the manual, Sybase supports recursive common table expressions.
So the following should work:
WITH RECURSIVE hierarchy_path (id, node_path) AS
(
SELECT id,
name as node_path
FROM the_unknown_table
WHERE id = 1
UNION ALL
SELECT c.id,
p.node_path || ' / ' || c.name
FROM the_unknown_table c
JOIN hierarchy_path p ON p.id = c.parent_id
)
SELECT *
FROM path
ORDER BY id
Not sure if Sybase uses the standard SQL concatenation operator ||
or something different. As Microsoft is ignoring the standard there, I guess Sybase uses the +
as well.