图片太小了看不清楚
假如我的眼睛没有看错的话,应该是这样,假设你的表名为node
SELECT nodeid,
(SELECT COUNT(0) AS hasChlid
FROM node
WHERE (nodeid LIKE n.nodeid + '%')) AS Expr1
FROM node AS n