select *
from table1
where parent in ( select parent from table1 group by parent having count(*)>1 )
from table1
where parent in ( select parent from table1 group by parent having count(*)>1 )
where TABLE1.id=t.id
from table1
where parent in ( select parent from table1 group by parent having count(*)>1 )只能显示出二条子记录,1 park这条记录也需要显示怎么改动语句扎瓦赫里朋友的代码不好使。。
1 park
2 1 park too
3 1 park too
4 wan
5 4 wan too
6 1 park too我就需要将其显示为:1 park
2 1 park too
3 1 park too
4 1 park too
5 wan
6 4 wan too
1 park
2 1 park too
3 1 park too
4 wan
5 4 wan too
6 1 park too我就需要将其显示为:id parent text
1 park
2 1 park too
3 1 park too
6 1 park too
4 wan
5 4 wan too
id parent text
1 park
2 1 park too
3 1 park too
4 wan
5 4 wan too
6 1 park too我就需要将其显示为:id parent text
1 park
2 1 park too
3 1 park too
6 1 park too
4 wan
5 4 wan too
想实现上面的这样的查询效果,使用什么样的语句