无限极分内 自联查询

select gtext,ftext,stext from (select a.id as gid,a.pid as gpid, a.text as gtext,b.id as fid,b.pid as fpid,b.text as ftext,c.id as sid,c.pid as spid,c.text as stext
from ag_base_area a join ag_base_area b on a.id=b.pid
left join ag_base_area c on b.id = c.pid order by stext) n
where fpid<1000 order by gtext

posted @ 2019-11-26 11:43  雨后丶云初霁  阅读(132)  评论(0编辑  收藏  举报