标签:join left join sel text from pid sele order by order
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
标签:join left join sel text from pid sele order by order
原文地址:https://www.cnblogs.com/cw828/p/11934443.html