Select 流水号,类型,名称,
营业厅=
(
  case when 类型='网点' then (select  name from aipu_BigType where sid=v_area.上级编号)
  end
),
分公司=
(
  case when 类型='营业厅' then (select  name from aipu_BigType where sid=v_area.上级编号)
       when 类型='网点' then (select name from aipu_BigType where sid=(select code from aipu_BigType where sid=v_area.上级编号))
  end
)

,编号,上级编号,创建时间,修改时间,修改者 from V_area

Last modification:November 14th, 2012 at 11:54 pm
如果觉得我的文章对你有用,请随意赞赏