菜单查询,关联别的表

来源:互联网 发布:如何修改淘宝地址 编辑:程序博客网 时间:2024/06/15 19:51
--查询关联数据
select a.name, a.status, nvl(b.price, 0) as price,c.amount as amount 
,c.prescriptionid
  from d_medical_service_item   a,
       d_medical_item           b,
       CLINIC_TOTAL_TYPE_MAPPNG c
 where exists (select 1
          from d_medical_service_item b
         where a.parent_code = b.code
           and b.parent_code = 12)
   and a.code = c.type_id(+)
   and a.code = b.id(+) and c.prescriptionid = 'cf10004';
0 0
原创粉丝点击