Q&A about the site for people who build and repair bicycles, people who train cycling, or commute on bicycles
SELECT q.id from posts q inner join posts p on q.id = coalesce(p.parentid, p.id) where p.owneruserid = ##UserId##