我正在阅读这篇文章,并尝试理解这个SQL语句,但我对SQL还比较新。
我不确定comment和c指的是什么。
我想其中一个是表名,但我不确定另一个是什么。另外,显然有一个子查询在其中,而我没有任何经验处理它:
SELECT c.id, c.user_id, c.body, c.deep, c.lineage, c.parent_id,
(SELECT COUNT(*)
FROM comment
WHERE comment.lineage LIKE (CONCAT(c.lineage,'%'))
AND comment.lineage != c.lineage) AS replies
FROM comment as c
ORDER BY c.lineage