之前一直用Oracle,一下子换到了Sql,有些语法还真不熟悉,再次记录一下:

with t1 as ( select a.dptname,a.parentid,a.deptid,a.status,a.typecode from base_dept a where a.deptid=2 union all select  d.dptname,d.parentid,d.deptid,d.status,d.typecode from base_dept d inner join base_dept c on d.parentid=c.deptid ) select * from t1

相关文章:

  • 2022-12-23
  • 2021-06-27
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2021-10-03
  • 2021-10-03
猜你喜欢
  • 2021-07-22
  • 2021-12-21
  • 2021-06-19
  • 2021-09-06
  • 2022-12-23
相关资源
相似解决方案