17,377
社区成员
发帖
与我相关
我的任务
分享
tname,tcdoe, pcode
一级 , t1, t0
二级 , t2, t1
三级 , t3, t2
select ltrim((select tname from t t1 where t1.code=t.pcode)||'-'||t.tname,'-'), t.tcode from t
[/quote]
谢谢
select ltrim((select tname from t t1 where t1.code=t.pcode)||'-'||t.tname,'-'), t.tcode from t
[/quote]
学习了,昨晚想了下,没想出来
select ltrim((select tname from t t1 where t1.code=t.pcode)||'-'||t.tname,'-'), t.tcode from t