select a.*,b.children from tree a,
(select sjbh,count(*) children from tree group by sjbh) b
where b.sjbh = a.bh and a.sjbh = 'o'
(select sjbh,count(*) children from tree group by sjbh) b
where b.sjbh = a.bh and a.sjbh = 'o'
to: Lastdrop(空杯)
你写的执行正确,能不能给我解释下呢?
to:pengdali(大力 V3.0)
按照你的给出的SQL语句出现如下错误:
ERROR 位于第 1 行:
ORA-00904: "NAME": 无效的标识符
其实你只是把bh,sjbh,name用*代替那,也不应该出现"NAME"无效的标识符,表里面明明有name该字段.能不能解释下?
哦我搞错那,表里是没有name字段,而是mc字段,而且按照pengdali(大力 V3.0) SQL语句运行结果完全正确.
请pengdali(大力 V3.0) 解释下那,为什么把bh,sjbh,name用*代替就行那呢?
where条件中加入了where sjbh = T.bh这个条件。