a_xiaokou 2016-01-21 02:18 采纳率: 0%
浏览 1721

mysql如何实现递归等级查询

在oracle中
select max(level) into max_level
from zj_template_option t
where t.enable = '1'
and t.template_id = '5'
--and level >='3'
and t.ispfx = '1'
start with t.pid = '0'
connect by prior t.id = t.pid
order by template_id;
把它改成mysql 如何实现,及查询的结果为
id pid level
1 0 1
2 1 2
......

大神能给个这样的函数吗
  • 写回答

1条回答 默认 最新

  • devmiao 2016-01-21 12:58
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?