码迷,mamicode.com
首页 > 其他好文 > 详细

无限极分内 自联查询

时间:2019-11-26 11:57:12      阅读:72      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!