I have a mysql table named "category". the basic structure looks like this-
------ -------- ------
cat_id cat_name parent
------ -------- ------
1 test1 NULL
2 test2 NULL
3 test3 2
4 test4 1
5 test5 3
现在我想到与母类别有关的所有类别数据 姓名。 在单项询问中(而不仅仅是id)。 这是可能的。 i 可以通过使用第二个查询(带孩子的母姓)来做,同时使用整个循环和合并的数据。 但这能否用一个单一问题来做?