SELECT id FROM thetable START WITH id = 1 CONNECT BY PRIOR next = id